OpenWrt Support for Armor G5 (NBG7815)

To get wireguard you should build your own firmware including luci-proto-wireguard until all kmod package wil be include on config.

wired?, wireless?, you should be more explicited.
With cable, I have reached 2.3 gb download and 1.8 gb upload if I remember correctly doing iperf3 to nbg7815 with pc conected on 2.5gb (light blue) port
10Gb (dark blue) port don't work at 2.5Gb. I don't 10gb hardware to test if that port woks at 10gb.
2.5Gb port works at

I have built my own image based on @avalentin's repository and have done some testing with HE160.
Although clients can connect to that wifi network, the speed achieved is lower than that achieved with HE80.
The clients used have all been intel ax210 cards.
Some data.

client ax210. data connection
windows 10
300.0 Mbit/s, 40 MHz, MCS 15, Short GI
300.0 Mbit/s, 40 MHz, MCS 15, Short GI

kubuntu 22.10
1200.9 Mbit/s, 80 MHz, HE-MCS 11, HE-NSS2
1297.1 Mbit/s, 160 MHz, HE-MCS 6, HE-NSS2

windows 11 same as win10
CANAL 36 SELECTED
data:
phy0-ap0  ESSID: 
          Access Point: 
          Mode: Master  Channel: 36 (5.180 GHz)  HT Mode: HE160
          Center Channel 1: 50 2: unknown
          Tx-Power: 20 dBm  Link Quality: 70/70
          Signal: -33 dBm  Noise: -110 dBm
          Bit Rate: 300.0 MBit/s
          Encryption: WPA2 PSK (CCMP)
          Type: nl80211  HW Mode(s): 802.11ac/ax/n
          Hardware: unknown [Generic MAC80211]
          TX power offset: unknown
          Frequency offset: unknown
          Supports VAPs: yes  PHY name: phy0
		  


iw dev
phy#0
        Interface phy0-ap0
                ifindex 13
                wdev 0x2
                addr 
                ssid 
                type AP
                channel 36 (5180 MHz), width: 160 MHz, center1: 5250 MHz
                txpower 20.00 dBm
                multicast TXQ:
                        qsz-byt qsz-pkt flows   drops   marks   overlmt hashcol tx-bytes        tx-packets
                        0       0       1909    0       0       0       0       308962          1909


CANAL 100 SELECTED
600 sec!!! waiting to dfs. I know this is a regulatory problem.

data:

BusyBox v1.35.0 (2023-01-04 02:52:42 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r21686-b93972f3f0
 -----------------------------------------------------
root@NBG7815:~# iwinfo
phy0-ap0  ESSID: 
          Access Point: 
          Mode: Master  Channel: 100 (5.500 GHz)  HT Mode: HE160
          Center Channel 1: 114 2: unknown
          Tx-Power: 24 dBm  Link Quality: 70/70
          Signal: -37 dBm  Noise: -108 dBm
          Bit Rate: 798.5 MBit/s
          Encryption: WPA2 PSK (CCMP)
          Type: nl80211  HW Mode(s): 802.11ac/ax/n
          Hardware: unknown [Generic MAC80211]
          TX power offset: unknown
          Frequency offset: unknown
          Supports VAPs: yes  PHY name: phy0

iw dev

phy#0
        Interface phy0-ap0
                ifindex 15
                wdev 0x3
                addr 00:03:7f:12:2f:1f
                ssid wlan_4048_5G
                type AP
                channel 100 (5500 MHz), width: 160 MHz, center1: 5570 MHz
                txpower 24.00 dBm
                multicast TXQ:
                        qsz-byt qsz-pkt flows   drops   marks   overlmt hashcol tx-bytes        tx-packets
                        0       0       2761    0       0       0       0       339879          2761

I have the same situation with Unifi HD, with AX200 card I get lower speed in 160Mhz band. I can confirm that this issue is not specific to this device. In general, 160Mhz is problematic. QCA9994 is a chipset that has been developed for years.

1 Like

After upgrading with your latest build, 160Mhz does not working.

Changing 5ghz to 160 Mhz (from Luci interface) provides the same strange information as in my build "6.450 Ghz"

When i added manually to /etc/config/wireless

option hwmode '11a' 

iwinfo returns proper 5 Ghz

phy0-ap0  ESSID: 
          Access Point: 
          Mode: Master  Channel: 36 (5.180 GHz)  HT Mode: HE160
          Center Channel 1: 50 2: unknown
          Tx-Power: 20 dBm  Link Quality: unknown/70
          Signal: unknown  Noise: -110 dBm
          Bit Rate: unknown
          Encryption: mixed WPA/WPA2 PSK (CCMP)
          Type: nl80211  HW Mode(s): 802.11ac/ax/n
          Hardware: unknown [Generic MAC80211]
          TX power offset: unknown
          Frequency offset: unknown
          Supports VAPs: yes  PHY name: phy0

And after few seconds I get signal, but it needs manual change at wireless config

1 Like

I forgot to say i did the same to make wifi works

Thanks! After a some more testing I see speeds up to 175 MB/s but only upload lan to wan, the other way only 85MB/s. I'll do further testing.

I can't do anything here. It all depends on robimarkos patches.

Ok, but when you write that something works, share full information(with commands), unless you did it but you don't know how.

It will help us with stabilization that software.

Of course, here are some details:

root@ap-nbg7815:~# iw dev
...
phy#0
   Interface wap-knet0
   	ifindex 35
   	wdev 0x6
   	addr 00:03:7f:12:XX:XX
   	type AP
   	channel 36 (5180 MHz), width: 160 MHz, center1: 5250 MHz
   	txpower 20.00 dBm
   	multicast TXQ:
   		qsz-byt	qsz-pkt	flows	drops	marks	overlmt	hashcol	tx-bytes	tx-

root@ap-nbg7815:~# iw dev wap-knet0 station dump
Station dc:e5:5b:00:XX:XX (on wap-knet0)
   inactive time:	610 ms
   rx bytes:	1780
   rx packets:	15
   tx bytes:	2539
   tx packets:	14
   tx retries:	72
   tx failed:	0
   rx drop misc:	0
   signal:  	-55 dBm
   signal avg:	-55 dBm
   tx bitrate:	1297.1 MBit/s 160MHz HE-MCS 6 HE-NSS 2 HE-GI 0 HE-DCM 0
   tx duration:	2776 us
   rx bitrate:	48.0 MBit/s
   rx duration:	2506 us
   authorized:	yes
   authenticated:	yes
   associated:	yes
   preamble:	long
   WMM/WME:	yes
   MFP:		yes
   TDLS peer:	no
   DTIM period:	3
   beacon interval:100
   short preamble:	yes
   short slot time:yes
   connected time:	8 seconds
   associated at [boottime]:	167848.738s
   associated at:	1673198529299 ms
   current time:	1673198536628 ms

/etc/config/wireless:
config wifi-device 'radio0'
   option log_level '0'
   option path 'platform/soc/c000000.wifi'
   option disabled '0'
   option hwmode '11a'
   option supported_rates '12000 18000 24000 36000 48000 54000'
   option channel '36'
   option band '5g'
   option htmode 'HE160'
   option type 'mac80211'
   option country 'DE'

That's with my latest build. I cannot see any difference to before.

I'll switch back to 80MHz because I want to test long term stability now.

1 Like

@avalentin
Please update your dts file to proper LED channels, as following:

diff --git a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-nbg7815.dts b/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-nbg7815.dts
index c1f9b2eeb3..79b095d67b 100644
--- a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-nbg7815.dts
+++ b/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-nbg7815.dts
@@ -613,10 +613,10 @@
                                color = <LED_COLOR_ID_BLUE>;
                        };

-                       led@6 {
+                       led@2 {
                                led-cur = /bits/ 8 <0xDF>;
                                max-cur = /bits/ 8 <0xFF>;
-                               reg = <0x6>;
+                               reg = <0x2>;
                                color = <LED_COLOR_ID_RED>;
                        };
                };
@@ -627,24 +627,24 @@
                        #size-cells = <0>;
                        reg = <0x1>;

-                       led@2 {
+                       led@3 {
                                led-cur = /bits/ 8 <0xDF>;
                                max-cur = /bits/ 8 <0xFF>;
-                               reg = <0x2>;
+                               reg = <0x3>;
                                color = <LED_COLOR_ID_GREEN>;
                        };

-                       led@3 {
+                       led@4 {
                                led-cur = /bits/ 8 <0xDF>;
                                max-cur = /bits/ 8 <0xFF>;
-                               reg = <0x3>;
+                               reg = <0x4>;
                                color = <LED_COLOR_ID_BLUE>;
                        };

-                       led@7 {
+                       led@5 {
                                led-cur = /bits/ 8 <0xDF>;
                                max-cur = /bits/ 8 <0xFF>;
-                               reg = <0x7>;
+                               reg = <0x5>;
                                color = <LED_COLOR_ID_RED>;
                        };
                };
@@ -655,17 +655,17 @@
                        #size-cells = <0>;
                        reg = <0x2>;

-                       led@4 {
+                       led@6 {
                                led-cur = /bits/ 8 <0xDF>;
                                max-cur = /bits/ 8 <0xFF>;
-                               reg = <0x4>;
+                               reg = <0x6>;
                                color = <LED_COLOR_ID_GREEN>;
                        };

-                       led@5 {
+                       led@7 {
                                led-cur = /bits/ 8 <0xDF>;
                                max-cur = /bits/ 8 <0xFF>;
-                               reg = <0x5>;
+                               reg = <0x7>;
                                color = <LED_COLOR_ID_BLUE>;
                        };

@@ -706,10 +706,10 @@
                                color = <LED_COLOR_ID_BLUE>;
                        };

-                       led@6 {
+                       led@2 {
                                led-cur = /bits/ 8 <0xDF>;
                                max-cur = /bits/ 8 <0xFF>;
-                               reg = <0x6>;
+                               reg = <0x2>;
                                color = <LED_COLOR_ID_RED>;
                        };
                };
@@ -718,24 +718,24 @@
                        #address-cells = <1>;
                        #size-cells = <0>;
                        reg = <0x1>;
-                       led@2 {
+                       led@3 {
                                led-cur = /bits/ 8 <0xDF>;
                                max-cur = /bits/ 8 <0xFF>;
-                               reg = <0x2>;
+                               reg = <0x3>;
                                color = <LED_COLOR_ID_GREEN>;
                        };

-                       led@3 {
+                       led@4 {
                                led-cur = /bits/ 8 <0xDF>;
                                max-cur = /bits/ 8 <0xFF>;
-                               reg = <0x3>;
+                               reg = <0x4>;
                                color = <LED_COLOR_ID_BLUE>;
                        };

-                       led@7 {
+                       led@5 {
                                led-cur = /bits/ 8 <0xDF>;
                                max-cur = /bits/ 8 <0xFF>;
-                               reg = <0x7>;
+                               reg = <0x5>;
                                color = <LED_COLOR_ID_RED>;
                        };
                };
@@ -744,17 +744,17 @@
                        #address-cells = <1>;
                        #size-cells = <0>;
                        reg = <0x2>;
-                       led@4 {
+                       led@6 {
                                led-cur = /bits/ 8 <0xDF>;
                                max-cur = /bits/ 8 <0xFF>;
-                               reg = <0x4>;
+                               reg = <0x6>;
                                color = <LED_COLOR_ID_GREEN>;
                        };

-                       led@5 {
+                       led@7 {
                                led-cur = /bits/ 8 <0xDF>;
                                max-cur = /bits/ 8 <0xFF>;
-                               reg = <0x5>;
+                               reg = <0x7>;
                                color = <LED_COLOR_ID_BLUE>;
                        };

For those who wants steering single color LED, below example of using channel0:

Red Led

echo 255 0 0 > /sys/devices/platform/soc/78b6000.i2c/i2c-0/0-0032/leds/q1:channel0/multi_intensity

Green Led

echo 0 255 0 > /sys/devices/platform/soc/78b6000.i2c/i2c-0/0-0032/leds/q1:channel0/multi_intensity

Blue Led

echo 0 0 255 > /sys/devices/platform/soc/78b6000.i2c/i2c-0/0-0032/leds/q1:channel0/multi_intensity

RGB

echo 255 255 255 > /sys/devices/platform/soc/78b6000.i2c/i2c-0/0-0032/leds/q1:channel0/multi_intensity
2 Likes

And after one week hard tests, everything seems working without problems, wifi working stable and till now don't have any problems, hence i voting for @avalentin PR to official repo.

1 Like

Thanks, I've updated the DTS!

OK, I will continue to maintain this until it can be merged.

Thank you for all your work on this!

2 Likes

The wifi problem afer reflash stiil present.
Yesteday i build new firmware with lastest commits and after flash keeping config there was no wifi. I reload everry radio and wifi work. I rebooted again to veryfy wifi and it was up. The problem is present only after first boot after sysupgrade.

i had used @avalentin repository.

btw. @avalentin According to bluetooth, i would consider to adding following diff

diff --git a/target/linux/ipq807x/image/generic.mk b/target/linux/ipq807x/image/generic.mk
index 57492f2e57..0c490146d3 100644
--- a/target/linux/ipq807x/image/generic.mk
+++ b/target/linux/ipq807x/image/generic.mk
@@ -131,6 +131,6 @@ define Device/zyxel_nbg7815
        IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k
        IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to 64k | sysupgrade-tar rootfs=$$$$@ | append-metadata
        DEVICE_PACKAGES := ipq-wifi-zyxel_nbg7815 kmod-ath11k-pci e2fsprogs kmod-fs-ext4 losetup kmod-hwmon-tmp103 \
-       kmod-leds-lp5569
+       kmod-leds-lp5569 kmod-bluetooth
 endef
 TARGET_DEVICES += zyxel_nbg7815

Is it only on the first upgrade? If yes, it is perhaps it is the wifi firmware downgrade.

I'm not sure about that!? There so much missing to get bluetooth working. (serial init, bluez,..)

I've got the ras image generator from zyxel. It is a bit more complex as expected. There are a lot of precompiled binaries in there (uboot, ARM firmware, 10G phy firmware) I'll have to check if I can leave that out and just pack the kernel and rootfs in the ras Image. But I can brick the device with that tries.

Also the decompilation of the tool itself is complex..

IPQ807x is upstream :slight_smile: Now it's time for us!

2 Likes

Well, if you unpack original zyxel ras image, there's only two important for us files:

  • openwrt-ipq-ipq807x_64-qcom-ipq807x-zyxel-fit-uImage.itb.padded
  • openwrt-ipq-ipq807x_64-squashfs-root.img

which is in the same format as kernel and rootfs from openwrt image,

so i suppose that files could be updated, only problem is with pack it again as RAS image.

EDIT:

unpacking RAS image (original Zyxel) to standard FIT image:

zyfw_extract -o ${fit_image} $ras_image

Inside FIT image there's lot of subimages which names are compatible with:

system_partnames="header 0:HLOS rootfs 0:WIFIFW"
zld_partnames="0:QSEE 0:DEVCFG 0:APDP 0:RPM 0:CDT 0:APPSBL"

get_full_section_name() {
	local img=$1
	local sec=$2

	dumpimage -l ${img} | grep "^ Image.*(${sec})" | \
		sed 's,^ Image.*(\(.*\)),\1,'
}

extract_subimages() {
	local img=$1

	for sec in $(print_sections ${img}); do
		local fullname=$(get_full_section_name ${img} ${sec})
		local position=$(dumpimage -l ${img} | grep "(${fullname})" | awk '{print $2}')
		local subimage_name=${tmp_dir}/${fullname}.bin
		flog "Extract subimage sec=${sec}, fullname=${fullname}, position=${position}"
		dumpimage -i ${img} -o ${subimage_name} -T "flat_dt" -p "${position}" ${fullname} > /dev/null || { \
			flog "!!! Error while extracting \"${sec}\" from ${img}"
			return 1
		}
	done
        return 0
} 

A tool to generate ras.bin images (mkrasimage) exists for the nbg6817 (ipq8065) and is also used for the nbg6617 (ipq40xx) and nbg6616 (ath79), hopefully the nbg7815 hasn't changed this format too much.

1 Like