Optimized build for IPQ40xx devices

Tried but still not working. With fstab preinstalled in the rom, the router cannot boot up. I guess the reason is misconfiguration of overlay. Luckily I can boot into failsafe and debrick the router. What I did was splitting this file as 2 scripts.

First one,78_syscfg_ubi_attach doing ubiattach before 80_mount_root.

#
# Copyright (C) 2014-2016 OpenWrt.org
# Copyright (C) 2016 LEDE-Project.org
#

syscfg_ubiattach() {
	. /lib/functions.sh

	case $(board_name) in
	linksys,caiman|linksys,cobra|linksys,mamba|linksys,rango|linksys,shelby|linksys,venom)
		needs_recovery=0
		syscfg_part=$(grep syscfg /proc/mtd |cut -c4)
		ubiattach -m $syscfg_part || needs_recovery=1
		if [ $needs_recovery -eq 1 ]
		then
			echo "ubifs syscfg partition is damaged, reformatting"
			ubidetach -m $syscfg_part
			ubiformat -y -O 2048 -q /dev/mtd$syscfg_part
			ubiattach -m $syscfg_part
			ubimkvol /dev/ubi1 -n 0 -N syscfg -t dynamic --maxavsize
		;;
	esac
}

boot_hook_add preinit_main syscfg_ubiattach
boot_hook_add failsafe syscfg_ubiattach

Second one, 81_linksys_syscfg keep the original logic for backup and restore after 80_mount_root.

#
# Copyright (C) 2014-2016 OpenWrt.org
# Copyright (C) 2016 LEDE-Project.org
#

preinit_mount_syscfg() {
	. /lib/functions.sh
	. /lib/upgrade/common.sh

	case $(board_name) in
	linksys,caiman|linksys,cobra|linksys,mamba|linksys,rango|linksys,shelby|linksys,venom)
		mkdir /tmp/syscfg
		mount -t ubifs ubi1:syscfg /tmp/syscfg
		[ -f "/tmp/syscfg/$BACKUP_FILE" ] && {
		echo "- config restore -"
		cd /
		mv "/tmp/syscfg/$BACKUP_FILE" /tmp
		tar xzf "/tmp/$BACKUP_FILE"
		rm -f "/tmp/$BACKUP_FILE"
		sync
		}
		;;
	esac
}

boot_hook_add preinit_main preinit_mount_syscfg

Then, the /etc/config/fstab in rom.


config global
	option anon_swap '0'
	option auto_swap '1'
	option auto_mount '1'
	option delay_root '5'
	option check_fs '0'
	option anon_mount '1'

config mount 'overlay'
	option device '/dev/ubi1_0'
	option target '/overlay'
	option enabled '1'
	option fstype 'ubifs'


When you do your changes and you go to failsafe mode, do you see the ubi nodes in the /dev?

Because for me the ubiattach is not enough for some reason and I do need to create the nodes manually, else the device will not boot.


Also, from failsafe mode you can see what's failing when you try to mount the root by running mount_root. It should fail but give you enough information about why it failed.

The failsafe mode which was booted into is the working partition. The one which I did sysupgrade from. I checked the /etc/config/ and no preinstalled fstab. So not much info useful. I did mount_root and I remember last sentence was “switched back to ubi overlay.” or something. And then reboot. The router booted to previous partition.

Maybe I need to copy all files in original /overlay to syscfg partition after mount_boot? The new firmware which is not booting because no config file or be loaded in new overlay?

Well, let me try to explain again.

It looks that before mounting the root overlay the ubiattach will not create the nodes in /dev, later when the device finds the entry in /etc/config/fstab but not the nodes in the /dev folder it will abort.

The idea here is to reach the failsafe mode in your modified firmware (where you changed your files) and check if the nodes are in /dev, if they are not, then create the nodes manually and issue mount_root.

If the nodes are in /dev, run mount_root. In either case, check if the mounted partition in /overlay is the syscfg.

OK. I did what you said and here's the output. I booted the router into failsafe and ran the command as below.

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

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 19.07.3, r11063-85e04e9f46
 -----------------------------------------------------
================= FAILSAFE MODE active ================
special commands:
* firstboot	     reset settings to factory defaults
* mount_root	 mount root-partition with config files

after mount_root:
* passwd			 change root's password
* /etc/config		    directory with config files

for more help see:
https://openwrt.org/docs/guide-user/troubleshooting/
- failsafe_and_factory_reset
- root_password_reset
=======================================================
root@(none):~# df -hT
Filesystem           Type            Size      Used Available Use% Mounted on
/dev/root            squashfs       24.8M     24.8M         0 100% /
tmpfs                tmpfs         512.0K         0    512.0K   0% /dev
tmpfs                tmpfs         249.5M     28.0K    249.5M   0% /tmp

root@(none):~# ls /dev
console             loop6               mtd6                mtdblock7           ubi0_0
cpu_dma_latency     loop7               mtd6ro              mtdblock8           ubi0_1
full                memory_bandwidth    mtd7                mtdblock9           ubi_ctrl
gpiochip0           mtd0                mtd7ro              network_latency     ubiblock0_0
gpiochip1           mtd0ro              mtd8                network_throughput  urandom
hw_random           mtd1                mtd8ro              null                usb1
i2c-0               mtd1ro              mtd9                port                usb2
kmsg                mtd2                mtd9ro              ptmx                usb3
loop-control        mtd2ro              mtdblock0           pts                 watchdog
loop0               mtd3                mtdblock1           random              watchdog0
loop1               mtd3ro              mtdblock2           shm                 zero
loop2               mtd4                mtdblock3           tty
loop3               mtd4ro              mtdblock4           ttyS0
loop4               mtd5                mtdblock5           ttyS1
loop5               mtd5ro              mtdblock6           ubi0

root@(none):~# ubiattach -m 8
UBI device number 1, total 296 LEBs (37584896 bytes, 35.8 MiB), available 0 LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)
root@(none):~# awk '/ubi1/{print $1}' /proc/devices
247
root@(none):~# mknod -m 600 /dev/ubi1 c 247 0
root@(none):~# mknod -m 600 /dev/ubi1_0 c 247 1
root@(none):~# ls /dev
console             loop6               mtd6                mtdblock7           ubi0_0
cpu_dma_latency     loop7               mtd6ro              mtdblock8           ubi0_1
full                memory_bandwidth    mtd7                mtdblock9           ubi1
gpiochip0           mtd0                mtd7ro              network_latency     ubi1_0
gpiochip1           mtd0ro              mtd8                network_throughput  ubi_ctrl
hw_random           mtd1                mtd8ro              null                ubiblock0_0
i2c-0               mtd1ro              mtd9                port                urandom
kmsg                mtd2                mtd9ro              ptmx                usb1
loop-control        mtd2ro              mtdblock0           pts                 usb2
loop0               mtd3                mtdblock1           random              usb3
loop1               mtd3ro              mtdblock2           shm                 watchdog
loop2               mtd4                mtdblock3           tty                 watchdog0
loop3               mtd4ro              mtdblock4           ttyS0               zero
loop4               mtd5                mtdblock5           ttyS1
loop5               mtd5ro              mtdblock6           ubi0

root@(none):~# mount -t ubifs /dev/ubi1_0 /tmp/mnt
root@(none):~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                24.8M     24.8M         0 100% /
tmpfs                   512.0K         0    512.0K   0% /dev
tmpfs                   249.5M     28.0K    249.5M   0% /tmp
/dev/ubi1_0              29.6M     28.0K     28.0M   0% /tmp/mnt

root@(none):~# umount /tmp/mnt
root@(none):~# mount_root
loading kmods from internal overlay
loading kmods from internal overlay
switching to ubifs overlay
root@(none):/rom/root# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                24.8M     24.8M         0 100% /rom
tmpfs                   512.0K         0    512.0K   0% /dev
tmpfs                   249.5M     28.0K    249.5M   0% /tmp
/dev/ubi0_1               3.1M    768.0K      2.2M  26% /overlay
overlayfs:/overlay        3.1M    768.0K      2.2M  26% /

I also tried to mknod before in preinit. The device can boot but overlay still the default one. Strange thing is when I add mknod, ubi1 and ubi1_0 did not appear in /dev of a normal boot up.

#
# Copyright (C) 2014-2016 OpenWrt.org
# Copyright (C) 2016 LEDE-Project.org
#

UBI_SYSCFG=1
UBI_EXTROOT=${UBI_SYSCFG}_0
SYSCFG_UBI=/dev/ubi${UBI_SYSCFG}
SYSCFG_NODE=0
EXTROOT_UBI=/dev/ubi${UBI_EXTROOT}
EXTROOT_NODE=1

preinit_mount_syscfg() {
	. /lib/functions.sh

	case $(board_name) in
	linksys,caiman|linksys,cobra|linksys,mamba|linksys,rango|linksys,shelby|linksys,venom)
		needs_recovery=0
		syscfg_part=$(grep syscfg /proc/mtd |cut -c4)
		ubiattach -m $syscfg_part || needs_recovery=1
		if [ $needs_recovery -eq 1 ]
		then
			echo "ubifs syscfg partition is damaged, reformatting"
			ubidetach -m $syscfg_part
			ubiformat -y -O 2048 -q /dev/mtd$syscfg_part
			ubiattach -m $syscfg_part
			ubimkvol /dev/ubi1 -n 0 -N syscfg -t dynamic --maxavsize
		fi

		node=$(awk '/'"ubi$UBI_SYSCFG"'/{print $1}' /proc/devices)
		if [ "x$node" != "x" ]; then
		      mknod -m 600 $SYSCFG_UBI  c $node $SYSCFG_NODE &> /dev/null
		      mknod -m 600 $EXTROOT_UBI c $node $EXTROOT_NODE &> /dev/null
		fi
		;;
	esac
}

boot_hook_add preinit_main preinit_mount_syscfg

Booted up and check mounts.

[root@WRT1900ACS:~]# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                24.8M     24.8M         0 100% /rom
tmpfs                   249.5M      2.7M    246.8M   1% /tmp
/dev/ubi0_1               3.1M    884.0K      2.1M  29% /overlay
overlayfs:/overlay        3.1M    884.0K      2.1M  29% /
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/sda1               915.9G    607.0G    263.2G  70% /mnt/sda1
[root@WRT1900ACS:~]# ls /dev
bsg                 loop3               mtd4ro              mtdblock5           tty
bus                 loop4               mtd5                mtdblock6           ttyS0
console             loop5               mtd5ro              mtdblock7           ttyS1
cpu_dma_latency     loop6               mtd6                mtdblock8           ubi0
crypto              loop7               mtd6ro              mtdblock9           ubi0_0
full                mapper              mtd7                network_latency     ubi0_1
gpiochip0           memory_bandwidth    mtd7ro              network_throughput  ubi_ctrl
gpiochip1           mtd0                mtd8                null                ubiblock0_0
hwrng               mtd0ro              mtd8ro              port                urandom
i2c-0               mtd1                mtd9                ppp                 watchdog
kmsg                mtd1ro              mtd9ro              ptmx                watchdog0
log                 mtd2                mtdblock0           pts                 zero
loop-control        mtd2ro              mtdblock1           random
loop0               mtd3                mtdblock2           sda
loop1               mtd3ro              mtdblock3           sda1
loop2               mtd4                mtdblock4           shm

Hi and thanks for your work. I've installed your version as the wifi performance of the official release was worse than the OEM firmware but I have some issues.

  1. The Status>Firewall page is empty other than the "Hide empty chains", "Reset Counters" and "Restart Firewall" buttons. I don't remember for sure but I don't think that was the case in the official version. The Network>Firewall page on the other hand appears to be working fine.

  2. When I first installed it I run "Update lists" to install SQM and UPnP, it worked but I didn't install them at the time. Later on when I tried doing it the "Update lists" button was stuck in the "Executing package manager, Waiting for the opkg update command to complete" for a while and ultimately failed with a "Unable to execute opkg update command: SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data" message. Trying Update lists immediately afterwards returns a "Errors, Collected errors: * opkg_conf_load: Could not lock /var/lock/opkg.lock: Resource temporarily unavailable. The opkg update command failed with code 255." message.

  3. Maybe it's related to the above but none of the tools in the Network>Diagnostics page work. The ping and traceroute return a "bad address" message whereas the nslookup returns a "connection timed out; no servers could be reached for nslookup" message. They both worked in the official version. Despite this I can access the internet fine through devices connected to the router.

  4. I don't know if the official version behaves the same way but changing the router's LAN IP from 192.168.50.1 to something else is a bit confusing as you can't do it with "Save&Apply". After it fails it informs you to try "Apply unchecked" which does work. From what I understand "Save&Apply" checks if the router is still reachable via the old IP address, not the new one, and when it fails it reverts the changes. Could changing the router's IP unintentionally cause the other problems? I only changed the Interfaces>LAN>IPV4 address but remember that this caused 3 pending changes.

In case it matters my setup is as described here with all devices connected through the OpenWrt router https://openwrt.org/docs/guide-user/network/wan/dmz-based-bridge-mode

EDIT: The ping and traceroute tools return the error messages with a url but work fine with an ip address.

Hi, thanks for your report!

First of all, let us know how the wireless is performing compared to the official OpenWrt for you.

After that:

  1. LuCI is buggy
  2. LuCI is buggy, but to work around it you can use the command line and run opkg by yourself, then reload the page and it should work. The device is scheduled to do it every midnight anyway so you don't really need to update manually.
  3. If I remember correctly, the URL that is in there is github.con, which I didn't choosed myself but it's infered from the build system. If you change it to www.github.com it should work. In shot: LuCI is buggy.
  4. You can change the default IP in the command line by modifying /etc/config/network and after that running the reload_config and waiting for it to come up with the new IP. The three other changes are probably some defaults that are already default but not present and LuCI gets offended and add them anyway.

Let us know about any other issue which may need a "LuCI is buggy" explanation, or if there is something in the system beyond LuCI that it's failing.

Ok, so the nodes are not generated automatically as I initial thought. So let me ask you the basic... Is your /etc/config/fstab actually in place and correctly configured?


There is a relevant part in the kernel log that may be useful, try to search for it:

[   19.730358] block: attempting to load /tmp/ubifs_cfg/upper/etc/config/fstab
[   19.739196] block: unable to load configuration (fstab: Entry not found)
[   19.745903] block: attempting to load /tmp/ubifs_cfg/etc/config/fstab
[   19.762061] UBIFS (ubi15:0): Mounting in unauthenticated mode

Also: move the mknod just after the ubiattach because there are commands that reference the nodes that doesn't exist yet in the if block.


Are the script files that you're adding to your firmware executables? What does ls -l /lib/preinit says? Remember that permissions are "inherited" from the permissions on the build machine to the firmware image.


Your script already provided the syscfg_part variable. Use it instead of the UBI_SYSCFG which is a workaround as my device doesn't provide any reference to it. You will need to adapt your definition variables and move them below the . /lib/functions.sh.


I know it's a hard work, it took me weeks and several disassembly and serial console debugs to get it working right, but I think it's worth it.

Ok, so I had to wait because of storms my electric service is not doing well, but I found something interesting that you may want to see:

I haven't tried the various calibration files yet, only the defaults. With the official release I usually had about 4-7ms ping, with this one 1-4ms, while the OEM firmware typically stayed at 1ms. I still have frequent lag spikes in the 20-100ms range but this is from a distant laptop with signal to noise -79/-102 dBm on 2.4GHz, which hasn’t improved compared to the official release (I don’t remember what it was with the OEM firmware). I haven't tested it with other devices yet.
I was also curious about a wifi security option that had a toggle in the official release but is absent here (not the KRACK countermeasures). I remember there was some fine print warning about it not being compatible with all devices, only some ath9k and ath10k, I think.
2. I tried that but got "Failed to establish connection *** Failed to download the package list from" for every package list and "Collected errors:
opkg_download: Failed to download http://whatever, wget returned 4.
opkg_download: Check your network settings and connectivity."
3. www.github.com doesn't work either. I tried to do it from the command line but the problem is the same as with LuCl, URL return "bad address" but pinging the ip address itself works. I wondered if it was a DNS thing but changing the DNS forwardings to 9.9.9.9 from the default 127.0.0.1 had no effect.

Thank you for your patience. Finally, it's done. Here I share my config files in case other WRT1900ACS users want to do the same thing.
IT'S ONLY TESTED ON OPENWRT 19.07.3 .
I saw snapshot changed directories and files. Need furthur customization I guess.

The fstab config file to be preinstalled here: 'target/linux/mvebu/base-files/etc/config/fstab'.

[root@WRT1900ACS:~]# cat /etc/config/fstab

config global
	option anon_swap '0'
	option anon_mount '0'
	option auto_swap '1'
	option auto_mount '1'
	option delay_root '5'
	option check_fs '1'

config mount 'overlay'
	option enabled '1'
	option enabled_fsck '1'
	option fstype 'ubifs'
	option options 'bulk_read,compr=zlib'
	option target '/overlay'
	option device '/dev/ubi8_0'

Find syscfg device by running command below. In my case for WRT1900ACS, it's mtd8.

[root@WRT1900ACS:~]# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00200000 00020000 "u-boot"
mtd1: 00040000 00020000 "u_env"
mtd2: 00040000 00020000 "s_env"
mtd3: 00100000 00020000 "devinfo"
mtd4: 02800000 00020000 "kernel1"
mtd5: 02200000 00020000 "ubi"
mtd6: 02800000 00020000 "kernel2"
mtd7: 02200000 00020000 "rootfs2"
mtd8: 02600000 00020000 "syscfg"
mtd9: 00680000 00020000 "unused_area"

Remove Preinit file 'target/linux/mvebu/base-files/lib/preinint/81_linksys_syscfg'. Split it into 2 files as below and put in the same folder.
File 1: 78_linksys_syscfg_overlay

#
# Copyright (C) 2014-2016 OpenWrt.org
# Copyright (C) 2016 LEDE-Project.org
#

preinit_mount_syscfg_overlay() {
	. /lib/functions.sh

	case $(board_name) in
	linksys,caiman|linksys,cobra|linksys,mamba|linksys,rango|linksys,shelby|linksys,venom)
		needs_recovery=0
		syscfg_part=$(grep syscfg /proc/mtd |cut -c4)
		ubiattach -m $syscfg_part -d $syscfg_part || needs_recovery=1
		if [ $needs_recovery -eq 1 ]
		then
			echo "ubifs syscfg partition is damaged, reformatting"
			ubidetach -m $syscfg_part
			ubiformat -y -O 2048 -q /dev/mtd$syscfg_part
			ubiattach -m $syscfg_part -d $syscfg_part
			ubimkvol /dev/ubi1 -n 0 -N syscfg -t dynamic --maxavsize
			echo "reformatting syscfg..." >> /tmp/syscfg_overlay.log
		else
			node=$(awk '/'"ubi$syscfg_part"'/{print $1}' /proc/devices)
			if [ "x$node" != "x" ]; then
				echo "creating syscfg node..." >> /tmp/syscfg_overlay.log
			    [ "$(ls /dev | grep ubi$syscfg_part)" == "" ] && mknod -m 600 /dev/ubi${syscfg_part} c $node 0 &> /dev/null && echo "creating /dev/ubi$syscfg_part ..." >> /tmp/syscfg_overlay.log
			    [ "$(ls /dev | grep ubi${syscfg_part}_0)" == "" ] && mknod -m 600 /dev/ubi${syscfg_part}_0 c $node 1 &> /dev/null && echo "creating /dev/ubi${syscfg_part}_0 ..." >> /tmp/syscfg_overlay.log
			fi
		fi
		mkdir /tmp/olaychk
		mount -t ubifs /dev/ubi${syscfg_part}_0 /tmp/olaychk && {
			[ -f "/tmp/olaychk/.syscfg_overlay" ] && echo "test mount ok..." >> /tmp/syscfg_overlay.log
			if [ -f "/tmp/olaychk/.firstboot" ]; then
				[ "$(ls -a /tmp/olaychk | grep .fs_state)" != "" ] && rm -f /tmp/olaychk/.fs_state && echo "delete old .fs_state..." >> /tmp/syscfg_overlay.log
				[ -d "/tmp/olaychk/upper" ] && rm -rf /tmp/olaychk/upper && echo "delete old upper..." >> /tmp/syscfg_overlay.log
				[ -d "/tmp/olaychk/work" ] && rm -rf /tmp/olaychk/work && echo "delete old work..." >> /tmp/syscfg_overlay.log
				[ -d "/tmp/olaychk/etc" ] && rm -rf /tmp/olaychk/etc && echo "delete old etc..." >> /tmp/syscfg_overlay.log
				rm -f /tmp/olaychk/.firstboot
			fi
			umount /tmp/olaychk
			rm -r /tmp/olaychk
		}
		;;
	esac
}

boot_hook_add preinit_main preinit_mount_syscfg_overlay

File 2: 81_linksys_syscfg

#
# Copyright (C) 2014-2016 OpenWrt.org
# Copyright (C) 2016 LEDE-Project.org
#

preinit_mount_syscfg() {
	. /lib/functions.sh
	. /lib/upgrade/common.sh

	case $(board_name) in
	linksys,caiman|linksys,cobra|linksys,mamba|linksys,rango|linksys,shelby|linksys,venom)
		syscfg_part=$(grep syscfg /proc/mtd |cut -c4)
		if [ "$(mount | grep overlay | grep ubi${syscfg_part}_0)" != "" ]; then
			# if mount syscfg as overlay successfully, then link /tmp/syscfg to /overlay.
			ln -s /overlay /tmp/syscfg && echo "ceate sombolic link for /tmp/syscfg ..." >> /tmp/syscfg_overlay.log
		else
			# if mount syscfg as overlay failed, then try to mount syscfg itself.
			mkdir /tmp/syscfg
			mount -t ubifs ubi1:syscfg /tmp/syscfg && echo "mount syscfg itself ..." >> /tmp/syscfg_overlay.log
		fi
		[ -f "/tmp/syscfg/$BACKUP_FILE" ] && {
			echo "restoring config ..." >> /tmp/syscfg_overlay.log
			echo "- config restore -"
			cd /
			mv "/tmp/syscfg/$BACKUP_FILE" /tmp
			tar xzf "/tmp/$BACKUP_FILE"
			rm -f "/tmp/$BACKUP_FILE"
			sync
		}
		;;
	esac
}

boot_hook_add preinit_main preinit_mount_syscfg

And append code in function platform_do_upgrade_linksys in file 'target/linux/mvebu/base-files/lib/upgrade/linksys.sh'.

platform_do_upgrade_linksys() {
...
	# if using syscfg as extroot, then create .firstboot file to indicate it's newly flashed rom.
	# when 78_syscfg_ubi_attach detects this file, it will delete old overlay files.
	syscfg_part=$(grep syscfg /proc/mtd |cut -c4)
	[ "$(mount | grep overlay | grep ubi${syscfg_part}_0)" != "" ] && touch /overlay/.firstboot
}

That's all the modifications needed. I didn't find a good solution to detect if it's first time boot. If you have better solution, please tell me.
Here's the larger size overlay. Take advantage of syscfg partition.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 19.07.3, r11063-85e04e9f46
 -----------------------------------------------------
[root@WRT1900ACS:~]# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                24.8M     24.8M         0 100% /rom
tmpfs                   249.5M      2.7M    246.8M   1% /tmp
/dev/ubi8_0              29.6M    700.0K     27.3M   2% /overlay
overlayfs:/overlay       29.6M    700.0K     27.3M   2% /
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/sda1               915.9G    607.1G    263.2G  70% /mnt/nas

After all, it took a lot of time to try and debug. Flash again and again. But finally, it's done. Thank you again for all the help! Cheers! :beers:

So I figured out my problem, the WAN interface was set to use 172.0.0.1 as a custom DNS. I must have messed it up.

EDIT: I didn't remember doing that so I reset the configuration to default and it turns out that's how it was setup by default!? At first everything worked correctly but then after making other changes through LUCI the same problem appears and is resolved by removing the custom DNS from the WAN interface. Was it meant to be 127.0.0.1 so that it is forwarded to unbound?

EDIT2: When trying to install SQM and UPnP (luci-app-sqm and luci-app-upnp), through either LUCI or SSH, I get these messages and the installation fails
Collected errors:

  • satisfy_dependencies_for: Cannot satisfy the following dependencies for luci-app-sqm:
  • kernel (= 5.4.46-1-fea46ceb72eba6990b1721877af6bac9)
  • opkg_install_cmd: Cannot install package luci-app-sqm.

The opkg install command failed with code 255.

Hola,

I got this router yesterday, and I first test it with stock firmware. I put a webserver on my computer and do a download from my phone (mi9t pro) and I can reach a download speed of 60 MB/s. But with this version of Openwrt it "only" reach around 43 MB/s All test close to the router.

Is this normal taking into consideration that we are using a open source driver? or should work like stock? What is your results?

Regards and thanks for the hard work!!

Hola!

Have you tested using wired connection? I understand that your phone lacks an Ethernet port, however, you can test with other client.

I would expect poor performance over wireless, but not due to the driver but due to a component of the wireless firmware that we don't understand yet.

In fact, it have been improved (at lest two times) over the last year. OpenWrt (the "official") does not contains the latest changes.

This build does contains the latest changes and a way to test all the possibilities. I'm not moving forward or settling in until I have enough information from users (in theory, people willing to help can test and report their performance).

Let us know about the wired performance, and then, if you wish, you can help us to understand what the heck is going on with the wireless performance.

Yes, the router is connected with wired connection to desktop computer with http server loaded with a big file (4.6 GB). Then I connect with the phone to the router with WiFi 5 Ghz. The connection seems ok, the speed is good, but not as good as the stock. Seems like we need a piece to complete puzzle.

On the other hand, I have two questions, yet I haven't test so much..

Seems that block-mount don't work well, at least using LuCI. I can connect a usb drive and is detected well, but I can't setup a mount point, It don't save in LuCI for some reason.. maybe the file permissions for store that block-mount data? Idk.

The other question is, how I can do to update (if I want in the future) the current Openwrt without lossing the stock firmware I have in the other partition?

Edit: By the way, can you add iperf3 to your next build? If is possible.
Edit2: Ups, I made a mistake in my first post. Is MB/s not Mbps.

I see that it sync at 866 Mbit/s, that's ok, but the download speed is fixed at 40 MB/s (around 320 Mbit/s)... BUT I got the same speed even with sync at 520 Mbit/s... that, for me, means that something else is blocking the max speed... not wifi itself... could be?

There are good chances that more fine-tunning is needed. The OEM firmware contains a worth of 1 or 2 MB (uncompressed) of shell scripts and sysctl configuratios that updates many values in the kernel and drivers. Most of the values and changes can't be "ported" because the open source drivers does not expose the same interface. This can be a problem of buffering, maybe the VLAN tagging is affecting since it's done in software, it can be a lot of things.

I'm aware of the problem, see: I use the OEM partition for packages, and that's not the default for OpenWrt. The partition is called syscfg, but OpenWrt is hardcoded to find the rootfs_data partition. It can't be renamed since it's an OEM partition, and patching a lot of code that relies on it will make things really hard. One of the workarounds that I implement is a pre-boot script that creates the nodes and a preconfigured /etc/config/fstbab, but the /overlay can't be modified anymore. To solve this, I use a symbolic link to the boot partition, but UCI seems to reject it with I/O error... you can temporary work arround it by moving the original file to the original location:

mv -f /rom/bootfs/upper/etc/config/fstab /etc/config/fstab

Boot to the OEM firmware and flash it again. Just to clarify: this ROM can revert back to OEM firmware at any time. Booting to OEM from OpenWrt, since I use the OEM partition, will make all of your settings to be reset anyway.


So for now I'm into solving the wireless performance, for sure, first and then eventually will make some "ports" of the OEM settings here. I've done already a couple of them but it looks like quite a lot of work is needed.


Have you tried enabling sotware offload in the firewall?

So seems this device is a bit complicated to make it working like stock does. I purchased this router for around 40€ in amazon uk (I am from Spain) but.. maybe there are better options for a similar price.

I have tried with software offload, but same results. Anyway, I am using the router like a dumb AP (no WAN, just connected to a random ethernet port and using a dhcp server from another router).

Anyway, thank you a lot for the work you are doing for this router. Keep it alive!

Hi NoTengoBattery,
Do you have any experience running WireGuard VPN client on this router? I've been playing around with it this past week, and while it seems to work great, there is a ~8 Mbps throughput drop when running the client on the router vs macbook. I wonder if there are some optimizations that could be had to get a performance boost.

Below are some speedtest result observations, the WG client config was the same between macbook and EA6350v3.

  • EA6350v3, speedtest on macbook (no WG control)
    ping 12ms, 42Mbps down, 29Mbps up (average of 3 runs)

  • EA6350v3, speedtest on macbook running WG client
    ping 12ms, 38Mbps down, 25Mbps up (average of 3 runs)

  • EA6350v3 running WG client, speedtest on macbook
    ping 12ms, 30Mbps down, 18Mbps up (average of 3 runs)