OpenWrt Support for Armor G5 (NBG7815)

This happens because i git clone avalentin repository and build my own image.
r0-3338b76 should be a direct download of @avalentin firmware. Someone correct me if I'm wrong

To update from the version of @avalentin I had installed to the master branch I needed to flash twice. The first time nothing had changed.
When I flashed a second time, when I rebooted, none of the 3 wifi radios were working, a simple reboot activated them. I think manually resetting them would had been enough too.
To go back to the previous firmware I have not had to flash twice. but i had to reset the wifi radios

PS: Don't install the current master version if you want to use LUCI. I have not been able to get LUCI to work correctly. I had a similar problem with the same version of LUCI on another router. The router itself works fine.

EDIT:
LUCI problem was my fault.. A "make clean" it neccesary to solve the problem as openwrt wiki suggests

seems to me that the processes get started again

@asvio i think it is one of the first bins done by @itorK

in the screenshot I forgot to kill {fanctld}, but lot of processes indeed come back after killing them

even fanctld, so I guess i should do something like systemctl but for openwrt ... service fanctld stop etc.

this is how i managed after stopping most of the services, still does not sysupgrade

root@OpenWrt:~# mtd -r write /tmp/openwrt-0124.bin firmware
Could not open mtd device: firmware
Can't open device for writing!
root@OpenWrt:~# mtd -r write /tmp/openwrt-0124.bin linux

same

root@OpenWrt:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00050000 00010000 "0:sbl1"
mtd1: 00010000 00010000 "0:mibib"
mtd2: 00020000 00010000 "0:bootconfig"
mtd3: 00020000 00010000 "0:bootconfig1"
mtd4: 00180000 00010000 "0:qsee"
mtd5: 00180000 00010000 "0:qsee_1"
mtd6: 00010000 00010000 "0:devcfg"
mtd7: 00010000 00010000 "0:devcfg_1"
mtd8: 00010000 00010000 "0:apdp"
mtd9: 00010000 00010000 "0:apdp_1"
mtd10: 00040000 00010000 "0:rpm"
mtd11: 00040000 00010000 "0:rpm_1"
mtd12: 00010000 00010000 "0:cdt"
mtd13: 00010000 00010000 "0:cdt_1"
mtd14: 000c0000 00010000 "0:appsbl"
mtd15: 000c0000 00010000 "0:appsbl_1"
mtd16: 00010000 00010000 "0:appsblenv"
mtd17: 00040000 00010000 "0:art"
mtd18: 00080000 00010000 "0:ethphyfw"
mtd19: 00010000 00010000 "0:crt"
mtd20: 00010000 00010000 "dual_flag"
mtd21: 00110000 00010000 "reserved"

so how can i update trough serial?

You don't need serial if you have root access by telnet or ssh.
Do this:

sysupgrade -n your_build.bin

After reboot check if you have new firmware, if not change your boot partition by script:

https://github.com/itorK/nbg7815_tools/blob/main/change_boot_partition.sh

Uh, ok, now i think with -n it did something and resulted in bricked device - i have 6 yellow (i think) leds, maybe light green, and no output to serial also

Update: I waited about 10 minutes, rebooted and i get output to console and it boots up and i get console output so gonna mess the partitions, hopefully that will do it

The hardware and the build of this device for the price is impressive, hopefully I will get it to behave.
What I do not understand is one metal plate that is actually all the antennas.

root@OpenWrt:/tmp# sh change_boot_partition.sh
: not found_partition.sh: line 4:
: not found_partition.sh: line 6:
change_boot_partition.sh: line 41: syntax error: unexpected end of file (expecting "then")

guess i will need to understand that script too :slight_smile:
?

root@OpenWrt:/tmp/nbg7815_tools# cat /etc/openwrt_release
DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='SNAPSHOT'
DISTRIB_REVISION='r0-3338b76'
DISTRIB_TARGET='ipq807x/generic'
DISTRIB_ARCH='aarch64_cortex-a53'
DISTRIB_DESCRIPTION='OpenWrt SNAPSHOT r0-3338b76'
DISTRIB_TAINTS='no-all'
root@OpenWrt:/tmp/nbg7815_tools# $(cat /etc/openwrt_release|grep DISTRIB_TARGET|cut -f 2 -d "'")
-ash: ipq807x/generic: not found
root@OpenWrt:/tmp/nbg7815_tools# cat /etc/openwrt_release|grep DISTRIB_TARGET
DISTRIB_TARGET='ipq807x/generic'
root@OpenWrt:/tmp/nbg7815_tools# openwrt_type=$(cat /etc/openwrt_release|grep DISTRIB_TARGET|cut -f 2 -d "'")
root@OpenWrt:/tmp/nbg7815_tools# ${openwrt_type}
-ash: ipq807x/generic: not found
root@OpenWrt:/tmp/nbg7815_tools# "DISTRIB_TARGET='ipq807x/generic'"|cut -f 2 -d "'"
-ash: DISTRIB_TARGET='ipq807x/generic': not found

I just don't understand what is going on, what is not found?

anyway, running it just like this

  echo "OpenWrt release"
  boot_part=$(hexdump -e '1/1 "%01x|"' -n 1 -s 168 -C /dev/mtd2|cut -f 1 -d "|"|head -n1)

  dd if=/dev/mtd2 of=boot.bin bs=336 count=1

  if [ ${boot_part} -eq 0 ]; then
    printf '\x01' | dd of=boot.bin bs=1 seek=168 count=1 conv=notrunc
  else
    printf '\x00' | dd of=boot.bin bs=1 seek=168 count=1 conv=notrunc

  fi

  mtd write boot.bin /dev/mtd2
  mtd write boot.bin /dev/mtd3

but I still tried to do just

root@OpenWrt:/tmp/nbg7815_tools# $(hexdump -e '1/1 "%01x|"' -n 1 -s 168 -C /dev/mtd2|cut -f 1 -d "|"|head -n1)
-ash: 0: not found
root@OpenWrt:/tmp/nbg7815_tools# hexdump -e '1/1 "%01x|"' -n 1 -s 168 -C /dev/mtd2|cut -f 1 -d "|"
0
000000a9

so this

  dd if=/dev/mtd2 of=boot.bin bs=336 count=1

  printf '\x01' | dd of=boot.bin bs=1 seek=168 count=1 conv=notrunc

  mtd write boot.bin /dev/mtd2
  mtd write boot.bin /dev/mtd3

is what I did and it does boot into
image

no luci thought :slight_smile: so same as @asvio

thank you so much for your support in figuring it out, i still do not understand the boot partition, there are 2 OSes at the same time and router just decides which to boot?

I guess https://downloads.openwrt.org/snapshots/targets/ipq807x/generic/ do not contain luci, right?

Also power consumption is under 8W, which is about 2/3 of the stock firmware

Thank you for helping me with this.

Even 160MHz Wifi is working (on the second interface)

Why are you messing around with partitions? Did you install a faulty build with fstools bug which @kirdes mentioned? I did miss that hint about a few hours before it got fixed and my device got bricked a few days ago. Yours is looking like its bricked. You should recover it instead trying to fix partitions. You would do more harm then good with your actions.

I assume you used copy-paste with windows CL/RF

Use wget command to download script and always check if content is similar with repo.

BTW. Use opkg to install luci:

opkg update
opkg install luci

You were right, 160Mhz is pretty much the same, still 1.2Gbps network speed with 2x2 device, would hoped for 2.4Gbps.

Nope, i did pull github and upladed using winscp.

Can someone help me? I did build an image using image builder with the new openwrt-imagebuilder-ipq807x-generic.Linux-x86_64.tar.xz. It worked with one problem.
In the manifest it says kernel 5.15.89.1 but when I install the respective openwrt-ipq807x-generic-zyxel_nbg7815-squashfs-sysupgrade.bin on the router I end up with kernel 5.15.83. What am I doing wrong? Cheers!

It is a bit offtopic here maybe
I did some experimenting with 160MHz and found out that:

  • I can use either interface to set it up, as long as I use ch36
  • second 5G still offers only channels 36 - 64
  • snapdragon 865 client uses ax 80MHz (I guess it is client limit) when connecting to the 160MHz network
  • Intel 200ax on windows uses 802.11N 300mbit 40MHz on 160MHz AX network
  • Intel 200ax on windows uses 802.11ax 1200mbit 80MHz on 80MHz AX network
  • Intel 200ax in linux uses 802.11ax 1200mbit 80MHz on 80MHz AX network
  • Intel 200ax in linux uses ... i dunno what, but i get 8mbit, if that, on 160MHz AX network

is there some way to know why intel ax200s chose to use slower protocols on slower speeds and is there a way to force to connect on AX and 160MHz?

Wed Jan 25 03:05:26 2023 daemon.notice hostapd: Remove interface 'phy0-ap0'
Wed Jan 25 03:05:26 2023 daemon.notice hostapd: phy0-ap0: interface state DFS->DISABLED
Wed Jan 25 03:05:26 2023 daemon.notice hostapd: phy0-ap0: AP-DISABLED
Wed Jan 25 03:05:26 2023 daemon.notice hostapd: phy0-ap0: CTRL-EVENT-TERMINATING
Wed Jan 25 03:05:26 2023 daemon.err hostapd: rmdir[ctrl_interface=/var/run/hostapd]: Permission denied
Wed Jan 25 03:05:26 2023 daemon.err hostapd: hostapd_free_hapd_data: Interface phy0-ap0 wasn't started
Wed Jan 25 03:05:26 2023 daemon.notice hostapd: nl80211: deinit ifname=phy0-ap0 disabled_11b_rates=0
Wed Jan 25 03:05:26 2023 kern.info kernel: [14395.135544] device phy0-ap0 left promiscuous mode
Wed Jan 25 03:05:26 2023 kern.info kernel: [14395.135695] br-lan: port 7(phy0-ap0) entered disabled state
Wed Jan 25 03:05:27 2023 daemon.notice netifd: Wireless device 'radio0' is now down
Wed Jan 25 03:05:27 2023 daemon.notice hostapd: Configuration file: /var/run/hostapd-phy0.conf (phy phy0-ap0) --> new PHY
Wed Jan 25 03:05:27 2023 kern.info kernel: [14395.777281] br-lan: port 7(phy0-ap0) entered blocking state
Wed Jan 25 03:05:27 2023 kern.info kernel: [14395.777320] br-lan: port 7(phy0-ap0) entered disabled state
Wed Jan 25 03:05:27 2023 kern.info kernel: [14395.781883] device phy0-ap0 entered promiscuous mode
Wed Jan 25 03:05:27 2023 kern.info kernel: [14395.787311] br-lan: port 7(phy0-ap0) entered blocking state
Wed Jan 25 03:05:27 2023 kern.info kernel: [14395.792442] br-lan: port 7(phy0-ap0) entered forwarding state
Wed Jan 25 03:05:27 2023 daemon.notice hostapd: phy0-ap0: interface state UNINITIALIZED->COUNTRY_UPDATE
Wed Jan 25 03:05:27 2023 kern.info kernel: [14395.798307] br-lan: port 7(phy0-ap0) entered disabled state
Wed Jan 25 03:05:27 2023 daemon.notice hostapd: phy0-ap0: interface state COUNTRY_UPDATE->HT_SCAN
Wed Jan 25 03:05:27 2023 kern.info kernel: [14396.233547] IPv6: ADDRCONF(NETDEV_CHANGE): phy0-ap0: link becomes ready
Wed Jan 25 03:05:27 2023 kern.info kernel: [14396.233784] br-lan: port 7(phy0-ap0) entered blocking state
Wed Jan 25 03:05:27 2023 kern.info kernel: [14396.239003] br-lan: port 7(phy0-ap0) entered forwarding state
Wed Jan 25 03:05:27 2023 daemon.notice netifd: Network device 'phy0-ap0' link is up
Wed Jan 25 03:05:27 2023 daemon.notice hostapd: phy0-ap0: interface state HT_SCAN->ENABLED
Wed Jan 25 03:05:27 2023 daemon.notice hostapd: phy0-ap0: AP-ENABLED
Wed Jan 25 03:05:28 2023 daemon.notice netifd: Wireless device 'radio0' is now up

only at least somewhat relevant thing i found in log

this is when trying to set 160Mhz on radio0 on CH100 (it reverts to 80MHz), but displays 160MHz in the web ui

Wed Jan 25 03:06:27 2023 daemon.info dnsmasq-dhcp[1]: DHCPACK(br-lan) 192.168.1.220 70:77:81:56:3b:6d AcerNitroV
Wed Jan 25 03:09:24 2023 daemon.notice hostapd: Remove interface 'phy0-ap0'
Wed Jan 25 03:09:24 2023 daemon.notice hostapd: phy0-ap0: interface state ENABLED->DISABLED
Wed Jan 25 03:09:24 2023 daemon.notice hostapd: phy0-ap0: AP-STA-DISCONNECTED 70:77:81:56:3b:6d
Wed Jan 25 03:09:24 2023 daemon.notice hostapd: phy0-ap0: AP-STA-DISCONNECTED 8c:c6:81:9d:82:12
Wed Jan 25 03:09:24 2023 daemon.notice hostapd: phy0-ap0: AP-STA-DISCONNECTED 08:91:15:43:35:e6
Wed Jan 25 03:09:24 2023 daemon.notice hostapd: phy0-ap0: AP-DISABLED
Wed Jan 25 03:09:24 2023 daemon.notice hostapd: phy0-ap0: CTRL-EVENT-TERMINATING
Wed Jan 25 03:09:24 2023 daemon.err hostapd: rmdir[ctrl_interface=/var/run/hostapd]: Permission denied
Wed Jan 25 03:09:24 2023 daemon.notice hostapd: nl80211: deinit ifname=phy0-ap0 disabled_11b_rates=0
Wed Jan 25 03:09:24 2023 kern.info kernel: [14632.853155] device phy0-ap0 left promiscuous mode
Wed Jan 25 03:09:24 2023 kern.info kernel: [14632.853297] br-lan: port 7(phy0-ap0) entered disabled state
Wed Jan 25 03:09:24 2023 daemon.notice netifd: Network device 'phy0-ap0' link is down
Wed Jan 25 03:09:25 2023 daemon.notice netifd: Wireless device 'radio0' is now down
Wed Jan 25 03:09:25 2023 daemon.notice hostapd: Configuration file: /var/run/hostapd-phy0.conf (phy phy0-ap0) --> new PHY
Wed Jan 25 03:09:25 2023 daemon.notice netifd: Network device 'phy0-ap0' link is up
Wed Jan 25 03:09:25 2023 daemon.notice netifd: Network device 'phy0-ap0' link is down
Wed Jan 25 03:09:25 2023 kern.info kernel: [14633.785567] br-lan: port 7(phy0-ap0) entered blocking state
Wed Jan 25 03:09:25 2023 kern.info kernel: [14633.785610] br-lan: port 7(phy0-ap0) entered disabled state
Wed Jan 25 03:09:25 2023 kern.info kernel: [14633.790161] device phy0-ap0 entered promiscuous mode
Wed Jan 25 03:09:25 2023 kern.info kernel: [14633.795703] br-lan: port 7(phy0-ap0) entered blocking state
Wed Jan 25 03:09:25 2023 kern.info kernel: [14633.800734] br-lan: port 7(phy0-ap0) entered forwarding state
Wed Jan 25 03:09:25 2023 daemon.notice hostapd: phy0-ap0: interface state UNINITIALIZED->COUNTRY_UPDATE
Wed Jan 25 03:09:25 2023 daemon.notice hostapd: phy0-ap0: interface state COUNTRY_UPDATE->HT_SCAN
Wed Jan 25 03:09:25 2023 kern.info kernel: [14634.070668] br-lan: port 7(phy0-ap0) entered disabled state
Wed Jan 25 03:09:25 2023 daemon.notice hostapd: phy0-ap0: interface state HT_SCAN->DFS
Wed Jan 25 03:09:25 2023 daemon.notice hostapd: phy0-ap0: DFS-CAC-START freq=5500 chan=100 sec_chan=1, width=2, seg0=114, seg1=0, cac_time=600s
Wed Jan 25 03:09:26 2023 daemon.notice netifd: Wireless device 'radio0' is now up

and after a while network from radio0 just disappears, nothing in log

Have you tried flashing a second time with the same firmware? I have to do it since the patches for the final "pr" were modified.

EDIT: I forgot to say if you reflash to check wifi status after the second flash. For me i need to restart all wifi radios.

All you say is the same for me except i'm using intel ax210.

@avalentin
There is some typos on your fan_ctrl.sh. They make the script not work.

line 13

  if [ -d /sys/class/gpio/fan/value ];then

shoud be

if [ ! -d /sys/class/gpio/fan/value ];then

line 19

if [ "$CPU_TEMP" -ge "$CPU_HIGH" -o "$WIFI0_TEMP" -ge "$WIFI0_HIGH" -o "$WIFI1_TEMP" -ge "$WIFI_HIGH" -o "$WIFI2_TEMP" -ge "$WIFI_HIGH" ];then

should be

if [ "$CPU_TEMP" -ge "$CPU_HIGH" -o "$WIFI0_TEMP" -ge "$WIFI_HIGH" -o "$WIFI1_TEMP" -ge "$WIFI_HIGH" -o "$WIFI2_TEMP" -ge "$WIFI_HIGH" ];then

line 21

elif [ "$CPU_TEMP" -lt "$CPU_LOW1" -o "$WIFI0_TEMP" -lt "$WIFI0_LOW" -o "$WIFI1_TEMP" -lt "$WIFI_LOW" -o "$WIFI2_TEMP" -lt "$WIFI_LOW" ];then

should be

elif [ "$CPU_TEMP" -lt "$CPU_LOW" -o "$WIFI0_TEMP" -lt "$WIFI_LOW" -o "$WIFI1_TEMP" -lt "$WIFI_LOW" -o "$WIFI2_TEMP" -lt "$WIFI_LOW" ];then

Yes, I tried to flash after a reboot and even after a firstboot with no effect.
I see installed snapshot r0-1ccb074 instead of what make info shows befor compiling.

Output of the make info command:
x86_64$ make info
Current Target: "ipq807x/generic"
Current Architecture: "aarch64"
Current Revision: "r21900-ac21dff5b6"

Here the same problem with attendedsysupgrade shown with screenshots. It doesnt install the firmware it should. I would be grateful for any hints as to what I can do. Cheers!

the above resulted in:

If I were in your situation, I would go back to the factory firmware, reset to default and install openwrt again with the new firmware downloaded from attendedsysupgrade.
It takes less than it seems.

Thank you! I will fix it at the weekend.

Did you tried change your boot partition?
For security reason(and to prevent bricking device) sysupgrade usually install firmware on other than actual boot partition, hence after upgrade you have to change your boot partition.