Optimized build for IPQ40xx devices

Seems like their is a way to use HNAT called fastpath or sfe. Is it possible to be used in this firmware?
For example: https://github.com/quarkysg/openwrt/commit/9ba313d46f6e06b712ef67b1300fe8b61c958b61 and https://github.com/gwlim/openwrt-sfe-flowoffload-ath79 and https://github.com/MeIsReallyBa/Openwrt-sfe-flowoffload-linux-5.4

Did you succeed with the nbg6617? I just got two units and would like to try out @NoTengoBattery 's build but it seems there is no nbg6617 build yet

I was low on time and I got enough devices so I put this aside. I'll reach out to him now

I guess we all are low on time most of the time :relaxed:

I installed standard openwrt for now and it works quite well as my main router for my use case, but having a second unit there is still space for some experiments, especially with vlans which i left alone for now.

Cable to computer (eth1GB/s)- 40-45Mbps internet/ 950Mbps with iperf (Software Flow Offload on)/780Mbps (SFO off)
Wireless 2.4G with 2 metres (smartphone)- 25-29Mbps internet/ 75-85Mbps with iperf
Wireless 2.4G with 10 metres (smartphone; two monolithic reinforced concrete interstorey floor and one load-bearing wall)- 15-18Mbps internet/ 20-22Mbps with iperf
Wireless 2.4G with 40 metres (smartphone; one load-bearing wall and outdoor)- 7-10Mbps internet/ 12-15Mbps with iperf
Wireless 5G with 2 metres (smartphone)- 35-40Mbps internet/ 320-350Mbps with iperf
Analogic in 5G how higher in 10 and 40 meters without link.

EA6350v3 with version 3.01 and ath10k/kmod-ath10k without -ct version and DK06 calibration files (with 2,4G and 5G). With ath10k-ct/kmod-ath10k-ct data rate is smaller.

In log kernel are few bugs (but dongle USB with LTE work, I do not connect disks):

[    4.296353] dwc3-qcom 8af8800.usb3: IRQ hs_phy_irq not found
[    4.297099] dwc3-qcom 8af8800.usb3: IRQ dp_hs_phy_irq not found
[    4.301468] dwc3-qcom 8af8800.usb3: IRQ dm_hs_phy_irq not found
[    4.306945] dwc3-qcom 8af8800.usb3: IRQ ss_phy_irq not found
[    4.314408] dwc3-qcom 60f8800.usb2: IRQ hs_phy_irq not found
[    4.318623] dwc3-qcom 60f8800.usb2: IRQ dp_hs_phy_irq not found
[    4.324362] dwc3-qcom 60f8800.usb2: IRQ dm_hs_phy_irq not found
[    4.329902] dwc3-qcom 60f8800.usb2: IRQ ss_phy_irq not found
[    4.337928] dwc3 8a00000.dwc3: Failed to get clk 'ref': -2
[    4.453528] dwc3 6000000.dwc3: Failed to get clk 'ref': -2

Sorry if this is offtopic...
Has anyone ever faced the issue that 5GHz wifi is not coming up / going down on it's own?

I tried deleting wifi config and rebuilding it. Often it's possible activating it when typing "wifi up" into an ssh console. I don't really understand when its working and when not.

Sometimes it's fine on ch 104 sometimes on ch 64. Now its set to ch 52 and not working at all...

Honestly I don't know where I should look for hints. The only pointer I found in dmesg was this here: Ath10k: "Firmware lacks feature flag..."

Maybe someone knows what this might be, or maybe it's fixed in this special rom?

Thanks for any idea.

Hi. I would like to give the calibration a try. Can you list the steps to create a combine 2.4 Ghz and 5 GHz file? Thanks

Type 'TestCalibration' in ssh terminal (e.g. putty, kitty...) and follow by instructions.

Standard calibration settings are in files of router, while new file (from another resources) to calibration may put to folder '/etc/calibration/EA6350v3/' and apply via command in ssh.

Example: Login in putty on router. Type 'TestCalibratoion AU/2G/Y9803_wifi0 hw_1/5G/DK04_5G' and execute. Restart wifi is automically, but I prefer restart router yet.
My commands window (for custom calibration files from an external source):

login as: root
root@192.168.52.1's password:
  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 NoTengoBattery v3.0.1, r16325-88151b8303
 -----------------------------------------------------
root@Civic:~# TestCalibration
Overview: Calibration script testing facility
Usage: TestCalibration <wifi0> <wifi1>
Epilog: Generate a calibration board file and replace the current in use with it.

 Available calibrations for <wifi0>:
  -- AH/2G/Y9803_wifi0
  -- AU/2G/Y9803_wifi0
  -- EU/2G/Y9803_wifi0
  -- FCC/2G/Y9803_wifi0
  -- IC/2G/Y9803_wifi0
  -- hw_1/2G/DK01_2G
  -- hw_1/2G/DK03_wifi0
  -- hw_1/2G/DK04_2G
  -- hw_1/2G/DK04_2G_neg_pwr
  -- hw_1/2G/DK05_2G
  -- hw_1/2G/DK07_wifi0_2G
  -- hw_1/2G/DK07_wifi0_5G_HB
  -- hw_1/2G/Y9803_wifi0
  -- hw_1/2G/YA131_wifi0
 Available calibrations for <wifi1>:
  -- AH/5G/Y9803_wifi1
  -- AU/5G/Y9803_wifi1
  -- EU/5G/Y9803_wifi1
  -- FCC/5G/Y9803_wifi1
  -- IC/5G/Y9803_wifi1
  -- hw_1/5G/DK01_5G
  -- hw_1/5G/DK03_wifi1
  -- hw_1/5G/DK04_5G
  -- hw_1/5G/DK04_5G_neg_pwr
  -- hw_1/5G/DK05_5G
  -- hw_1/5G/DK07_wifi1_5G_LB
  -- hw_1/5G/Y9803_wifi1
  -- hw_1/5G/YA131_wifi1

Use the special value 'default' for either argument (or both) to regenerate the
default, which is the best, calibration and restore it.
Use the special value 'alternative' for either argument (or both) to generate a
calibration with the best alternative calibration.

 Oever González <software@notengobattery.com>

root@Civic:~# TestCalibration DK06_2G DK06_5G
Calibration board file successfully updated. The network will restart now.
root@Civic:

Update:
A comparison of the calibration settings is here, but this is no all mayble files of calibration.

Hello,

I currently have the official OpenWrt build on ea6350v3 and it's working ok, but I want to try the optimized build as well. I know that the device has 2 partitions and I can see them in the advanced reboot.I got an old version of OpenWrt on the alternate partition that I would like to replace with this build.

1.Does flashing this build affect both partitions?
2.If not, when flashing from luci does it flash to current partition or alternate partition?

Thank you!

Very lucky to see you and @NoTengoBattery 's discussion.

My knowledge of linux and openwrt is very superficial. Although I tried very hard to use the discussion on that topic as a guide to achieve my purpose, I found that v21.02.1 looks to have undergone a major change. This change makes your previous code no longer appropriate. I would appreciate if you could make some adjustments to your code for this version if you have the time.

The attached image is a little bit of my understanding about the topic, although I can't confirm if it's correct or not. It is only for others to use as a reference for discussion.

If you or @NoTengoBattery have the time and interest, would it be possible to make the code for this topic a generic solution and place it on github? I would love to do it, but my skills on this are really lacking.

By the way, I have seen the code about add middle layer to overlayfs. I hope it will be useful for the discussion.

Once again, thank you and @NoTengoBattery for the great discussion.

1 Like

On another note, I saw recent vulnerabilities for samba4 were patched in 4.14.12.

Do you know if you can update the packages to the latest version? I know that openwrt has them in their repos, and I saw on your repo that they are on 4.14.7.

I am aware though that if what aaronhcn is saying is the case, then things might not be updated for a while to adapt to the new architecture.

Thank you!

@aaronchn Yes, you totally nailed it. However, I don't quite get the point.


@siliconninja Even tho those packages are stored in my server, your device will not use them. This build will use as many packages from OpenWrt as possible, and Samba is one of those. Generally speaking, my server only provides the kernel modules and a couple of core packages, plus my custom packages.

1 Like

English is not my native language and I need the help of a translation tool to complete my expressions. I am very sorry for the trouble I have caused you.

I just wish there was a tool or a few snippets of code that would enable the syscfg partition on most dual partitioned devices (say EA6350v3 or 1900ACS).

This tool or code would be better placed on github, so that people interested in this feature can keep improving it.

Please ignore it if my expression is not accurate enough.

1 Like

Oh yeah it does exist. It is in my custom feed. Here's the link:

This thread is pretty awesome, it answered/confirmed all what I think is problematic in my EA8300 and his bigger twin MR8300.

I'm going to try it on the MR8300. I case I don't survive this, I like to thank NoTengoBattery for all the work, all the replies on questions and the relentless follow-up I've seen reading this, if this solves my VLAN/SWITCH problem and also the general performance of both routers I'll be eternally greatful , but in fact, even if it doesn't I'm still happy to have found this thread.

I got mesh networking to work with batman between both nodes in the latest generic openwrt but the minute I touch vlan's I hit issues. If I can provide any details or things you like me to test, let me know, I'm ready to give back here.

Tried the EA8300 first:

dmesg on the EA8300

glenn@zenny:~$ ssh 192.168.1.2 -l root
  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 NoTengoBattery v3.0.1, r16325-88151b8303
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@Dallas:~# 

my dmesg

Right of the bat a few awesome things I notice:

  • The switch now contains the WAN port as well - problem 1 solved :white_check_mark:
  • Ping is faster (also on between 2 routers on the lan wired :white_check_mark:

Not sure now if for mesh/batman setup I now can use the -CT drivers, I've been reading on this https://cgomesu.com/blog/Mesh-networking-openwrt-batman/#bonus-content-moving-from-openwrt-19-to-21 blog here that the author suggests removing them. But with all the patches made, is it still needed for optimal functionality?

but so far , pretty promising. I'm willing to make a donation @NoTengoBattery , both time/test/feedback and financially. I feel like I owe you and haven't even tested everything but this is at the moment THE solution for this router to reach it full potential.

Well, I don't know about the CT kernel module and firmware. I do not have such an use case and thus haven't tested it deeply.

I would recommend trying the current configuration and changing things only if you're facing issues or the default configuration does not fit your needs.

Again, as a general advice in software, keep the things default unless you are having issues, you know exactly what you're doing or you are willing to fix something if you break it :blush:

Yea, so true. I'm also compiling your work at the moment, I got an interactive question all the sudden on a missing config settings: (cpu scheduler related). I answered 'N' as it was the default.

UCLAMP_TASK_GROUP
(probably had to do a make oldconfig which I didn't)

on the EA8300 , the current loaded ath modules are:

root@Dallas:~# lsmod | grep -i ath
ath                    24576  1 ath10k_core
ath10k_core           430080  1 ath10k_pci
ath10k_pci             49152  0 
cfg80211              286720  4 batman_adv,ath10k_core,ath,mac80211
hwmon                  16384  1 ath10k_core
mac80211              516096  1 ath10k_core

I have a gut feeling that this author replaced those drivers because he also experienced some issues, I'm going to keep it as it is for the moment, from all I'm seeing here they seem to fly like an eagle. Since I don't really know the intrinsic differences in those drivers , I think I belong in the category: Don't know exactly what I'm doing so I'm going to set everything up and keep those drivers as provided in your build.

Let me know if you want something tested on these routers @NoTengoBattery . I read you had some testers who lack sending you feedback, I'll do better :wink:

Cheers again

Hi,

Little update for those among us trying to get Mesh to work on tri-band devices like EA8300 and MR8300 using a dedicated backhaul, Before using @NoTengoBattery build, I was unable to ping from node02 to node01 on the lan addreses. So 192.168.1.2 and 192.168.1.1 , Unless I attached a cable between the lan ports. (duh) . But after using those builds and setting it up like below I could unplug the cable and everything kept working, having node02 only connected via bat0 backhaul bridged it worked.

But I was always able to use batctl p and batctl n to show that the mesh seemed to work. This is a really huge step forward . while I was messing about in the settings with the bridges and so on, there seemed to be nothing wrong with the configuration of network/wifi at all.

Some noteworthy need-to-knows for this to work:

  • set gw_mode to the proper modes, server and client
  • using @NoTengoBattery 's build, it actually shows the interfaces with their vlan id. So before I used the openwrt generic build, those did not show up, instead I got eth0 , eth1 and not their vlan counterparts
  • use the full wpad-wolfssl and not just wpad-mesh-wolfssl . It made a big difference
  • at some point, when uninstalling wpad-* packages, I had it happen on both routers that unload dns resolver seems to crash/stop working and then opgk install will fail to work (and confuse you). On the EA8300 it restarted itself and I didn't at first understand what happened, I thought it was the ssl package I just de-installed preventing opgk update to work. on the MR8300 it also stopped at exactly the same stage, but did't restart , also a restart of the router didn't seem to work, I guess it crashed because the wolfssl wasn't present and it probably needs it. But restarting later , and/or manually assigning a dns server like 8.8.8.8 in resolv.conf did the trick, then you install wpad-wolfssl immediately and the problem is gone.
  • I never manually assigned a MAC address, best way to avoid duplicate macs, I was able to export a backup tar.gz , extracted it locally, modded the settings, ip's and then upload it to the other node and it worked right of the bat(man). changed the ip's/dns
  • I had some issues trying to sysupgrade between both partitions, when they still had their stock firmware on 1. It failed a few times. I now have openwrt generic on the 'other' partition and @NoTengoBattery 's build on the other. using -n on sysupgrade from generic openwrt made me able to login properly using a cable in the lan port when it booted the alternative partition. when I didn't use -n the switch layout gets all screwed up and I got a few pings through while they booted but then they got all closed off, but booted fine so they didn't fall back to the other boot partition
  • for those 2 routers to manually make them switch boot partition, just boot 3 times, unplug the cable the second you see the WAN port go live with repeated flashing (after the lan ports do their little progress-bar-like flashing), and it will work. I had a little catch-22 there but having openwrt on both partitions was the solution, so I got rid of the stock firmware entirely.

Feel free to comment on these, in case I missed something or use bad practices etc. It's the first time I messing with mesh-capable devices. I only use the 2.4Ghz here to get proof-of-concept to work and the 3rd 5GHz band is disabled here.

You need these packages:

opkg install batctl-full kmod-batman-adv wpad-wolfssl

But de-install the conflicting ones first.

Finally, a few remarks on the @NoTengoBattery build, there are little gems in there, like the (b)ash history that is kept even when disconnecting, there are little things in there that are so handy to have around. I did notice that the memory use is a lot higher due to some additional setup differences, like the added swap, that isn't in the stock openwrt build. I doesn't seem to be a problem, but the EA8300 does have only half the memory of the MR8300. I never used those memory things, but in luci they can be modified.

I tried building those packages from the source and was able to successfully install them on my router, but it seems the kernel version is not the same as the @NoTengoBattery images that he so kindly made, which have a slighly higher kernel version. I haven't dug into that yet to see why as I'm using a clone of the github repo, but in any case.. the build ran fine , after installing it I did have to do a hard reset of the modem and launch the firstboot script to kinda clean it up and after a reboot it loaded all the modules fine and set the cli prompt to dallas like the prebuilt images. I did not use the -ct drivers as mentioned in many blogs, the patched drivers here perform excellent.

the configs

MR8300 - router 1 - WAN gateway

root@router1:~# cat /etc/config/network


config interface 'loopback'
	option device 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fdb2:74b3:833d::/48'
	option packet_steering '1'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'bat0'
	list ports 'eth0.1'

config interface 'lan'
	option device 'br-lan'
	option proto 'static'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option ipaddr '192.168.1.1'
	list dns '192.168.1.1'
	list dns '192.168.1.2'

config interface 'wan'
	option device 'eth0.2'
	option proto 'dhcp'
	option dns '127.0.0.1'
	option peerdns '0'

config interface 'bat0'
	option proto 'batadv'
	option routing_algo 'BATMAN_IV'
	option aggregated_ogms '1'
	option ap_isolation '0'
	option bonding '0'
	option bridge_loop_avoidance '1'
	option distributed_arp_table '1'
	option fragmentation '1'
	option gw_mode 'server'
	option hop_penalty '30'
	option isolation_mark '0x00000000/0x00000000'
	option log_level '0'
	option multicast_mode '1'
	option multicast_fanout '16'
	option network_coding '0'
	option orig_interval '1000'

config interface 'mesh'
	option proto 'batadv_hardif'
	option master 'bat0'
	option mtu '1536'

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option ports '1 2 3 4 0t'

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '5 0t'

root@router1:~# cat /etc/config/wireless


config wifi-device 'radio0'
	option type 'mac80211'
	option channel '153'
	option hwmode '11a'
	option path 'soc/40000000.pci/pci0000:00/0000:00:00.0/0000:01:00.0'
	option htmode 'VHT80'
	option disabled '0'
	option country 'BE'
	option cell_density '0'

config wifi-device 'radio1'
	option type 'mac80211'
	option channel '6'
	option hwmode '11g'
	option path 'platform/soc/a000000.wifi'
	option country 'BE'
	option cell_density '0'

config wifi-iface 'default_radio1'
	option device 'radio1'
	option network 'lan'
	option mode 'ap'
	option encryption 'psk2'
	option key '2Hot4u3hardy'
	option ssid 'dd-wrtg'

config wifi-device 'radio2'
	option type 'mac80211'
	option channel '36'
	option hwmode '11a'
	option path 'platform/soc/a800000.wifi'
	option htmode 'VHT80'
	option disabled '1'
	option country 'BE'
	option cell_density '0'

config wifi-iface 'wmesh'
	option device 'radio0'
	option network 'mesh'
	option mode 'mesh'
	option mesh_id 'MeshCloud'
	option encryption 'sae'
	option key 'MeshPassword123'
	option mesh_fwding '0'
	option mesh_ttl '1'
	option mcast_rate '24000'
	option disabled '0'

EA8300 - router2 - mesh client

root@router2:~# cat /etc/config/network


config interface 'loopback'
	option device 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fdb2:74b3:833d::/48'
	option packet_steering '1'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'bat0'
	list ports 'eth0.1'

config interface 'lan'
	option device 'br-lan'
	option proto 'static'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option ipaddr '192.168.1.2'
	option gateway '192.168.1.1'
	list dns '192.168.1.1'
	list dns '192.168.1.2'

config interface 'wan'
	option device 'eth0.2'
	option proto 'dhcp'
	option dns '127.0.0.1'
	option peerdns '0'

config interface 'bat0'
	option proto 'batadv'
	option routing_algo 'BATMAN_IV'
	option aggregated_ogms '1'
	option ap_isolation '0'
	option bonding '0'
	option bridge_loop_avoidance '1'
	option distributed_arp_table '1'
	option fragmentation '1'
	option gw_mode 'client'
	option hop_penalty '30'
	option isolation_mark '0x00000000/0x00000000'
	option log_level '0'
	option multicast_mode '1'
	option multicast_fanout '16'
	option network_coding '0'
	option orig_interval '1000'

config interface 'mesh'
	option proto 'batadv_hardif'
	option master 'bat0'
	option mtu '1536'

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option ports '1 2 3 4 0t'

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '5 0t'

root@router2:~# cat /etc/config/wireless

config wifi-device 'radio0'
	option type 'mac80211'
	option channel '153'
	option hwmode '11a'
	option path 'soc/40000000.pci/pci0000:00/0000:00:00.0/0000:01:00.0'
	option htmode 'VHT80'
	option disabled '0'
	option country 'BE'
	option cell_density '0'

config wifi-device 'radio1'
	option type 'mac80211'
	option channel '6'
	option hwmode '11g'
	option path 'platform/soc/a000000.wifi'
	option country 'BE'
	option cell_density '0'

config wifi-iface 'default_radio1'
	option device 'radio1'
	option network 'lan'
	option mode 'ap'
	option encryption 'psk2'
	option key '2Hot4u3hardy'
	option ssid 'dd-wrtg'

config wifi-device 'radio2'
	option type 'mac80211'
	option channel '36'
	option hwmode '11a'
	option path 'platform/soc/a800000.wifi'
	option htmode 'VHT80'
	option disabled '1'
	option country 'BE'
	option cell_density '0'

config wifi-iface 'wmesh'
	option device 'radio0'
	option network 'mesh'
	option mode 'mesh'
	option mesh_id 'MeshCloud'
	option encryption 'sae'
	option key 'MeshPassword123'
	option mesh_fwding '0'
	option mesh_ttl '1'
	option mcast_rate '24000'
	option disabled '0'

Hope this helps someone trying to do this on a router

1 Like

Well, the fact that you had to use a manual DNS is because in the default configuration, Unbound uses DNS over TLS that, you may guess, needs a SSL provider library.

On the other hand, "upgrading" from vanilla OpenWrt to this build is know to soft brick the device. This is the only circumstance where the -n may be required.

The build can be upgraded with a newer version of itself without trouble, but switching between vanilla and this build in any direction with keeping settings will make the device inaccesible.

I would say that everything's working as expected. Shall you face a bug, let us know.

1 Like

I agree, I didn't know unbound before I used this and lookin at the config I saw the TLS dependancies so that all made sense that in between package removal and install of the full ssl package there was a little situation where I was in no-man's land :slight_smile: . Using an external DNS was the solution, and after reboot the resolv.conf file was already reset, so great stuff

I was able to upgrade (using sysupgrade image) fine though, but even not using -n and doing a reset of the router to defaults on your build made me able to login again, but I now start to think that that is exactly what you mean with soft-bricking :wink:

the -n is still good if you want to start from zero, because of the bad switch functionality of openwrt generic build for this router (due to the driver problems I assume) , starting with a clean setup has proven to be the correct approach, in the end, it's only 2 files that need some love for this all to work and an install of a few packages. So I just manually merged the devices/interfaces into a clean install and that only takes 15minutes for 2 routers.

I do beg to differ : It's not working as expected. It's working BETTER than expected , it's just awesome I have them working perfectly. I do notice that DNS in unbound seems a bit slower with uncached requests than dnsmasq would be, but I think you made a few remarks on that already, which I read here and remembered, nothing to write home about, once the dns cache is filled up, I didn't see any stability or speed problems. Unbound looks interesting to play with so I'm keeping it for now. I do see that dnsmasq is running too on my install, but it doesn't seem to interfere with unbound for now, I still have lots of research to do in each component, so many options is going to take time to understand how they interact.

The only small thing I worry about it the memory footprint and the use of swap, but need to read up on those as well before I understand the implications.

So I would say : These things works like a true champ now , it's quite awesome man. You really know your stuff. I published my findings because I couldn't find someone who uses a dedicated backhaul with these 2 devices in the forums like I do, so just hope this feedback can be useful for others.

Thank you