OpenWrt Support for Armor G5 (NBG7815)

I'm sure that would have worked too. But I went back to orginal firmware and reflashed openwrt. Finally it works! Thanks to all of you for your support!

Should LEDs be properly working? When I was on an older snapshot image (r0-1ccb074, kernel 5.15.83) I could configure the LEDs in luci just fine. Now, with r21922-6e428a8490 (kernel 5.15.90), it doesn't work anymore. Is that a problem with my firmware image or is it a general problem still unsolved? Thanks for any hints. Cheers!

Openwrt master snapshot do not support led and fan. @avalentin is working on version to pr.
@avalentin also have a build with led and fan support.

@avalentin , You need rewrite this line again.

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

Correct would be

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

:rofl:
Could you check? I currently do not have access.

I have access :rofl:
But i see no change jet.

Corect should be

[ ! -d

Though [ - f also should work
I change to first one and work perfect.

Edit: Now i see your change :wink: :wink:

Pushed the final version:-)

1 Like

I've removed my build,. but not the repo. It seems it is to complicated for most people and they should use the OpenWRT builds.

For everyone else with knowledge, it should be easy to add the needed changes to their local build.

I understand your point of view and I share it.

It's only me who need to flash 2 time with oficial openwrt builds?

Check where your system is installed on:

hexdump -e '1/1 "%01x|"' -n 1 -s 168 -C /dev/mtd2 | cut -f 1 -d "|" | head -n1

0 => rootfs
1 => rootfs_1

Perhaps it has something to do the second rootfs and the way the upgrade

Another check is:
cat /proc/cmdline
Note the UUID
lsblk
See which device it is on by looking for the UUID.

Mine runs rootfs_1. But it somehow depends on the initial install.
Even after an update, I do not expect to change it after update.

Mine runs rootfs_1 too.
I checked some days ago. I've tried to change partition but no lack.
If i find a solution i will post it.

Thanks for the info. And the great work. Its much appreciated!

@avalentin
@itorK
@robimarko
More about my sysupgrade problem.
It seems to be a problem the system cannot kill the hostapd process due to ath11k problem, and therefore the system update is cancelled.

Watchdog handover: fd=3
- watchdog -
Watchdog did not previously reset the system
Sat Jan 28 11:49:15 CET 2023 upgrade: Sending TERM to remaining processes ...
Sat Jan 28 11:49:15 CET 2023 upgrade: Sending signal TERM to hostapd (1764)
Sat Jan 28 11:49:15 CET 2023 upgrade: Sending signal TERM to hostapd (1780)
Sat Jan 28 11:49:15 CET 2023 upgrade: Sending signal TERM to netserver (1988)
[  363.715864] device phy2-ap0 left promiscuous mode
[  363.715983] br-lan: port 8(phy2-ap0) entered disabled state
[  363.975736] device phy1-ap0 left promiscuous mode
[  363.975840] br-lan: port 9(phy1-ap0) entered disabled state
Sat Jan 28 11:49:19 CET 2023 upgrade: Sending KILL to remaining processes ...
Sat Jan 28 11:49:19 CET 2023 upgrade: Sending signal KILL to hostapd (1764)
Sat Jan 28 11:49:19 CET 2023 upgrade: Sending signal KILL to hostapd (1780)
Sat Jan 28 11:49:19 CET 2023 upgrade: Sending signal KILL to hostapd (1780)
Sat Jan 28 11:49:19 CET 2023 upgrade: Sending signal KILL to hostapd (1780)
Sat Jan 28 11:49:19 CET 2023 upgrade: Sending signal KILL to hostapd (1780)
Sat Jan 28 11:49:19 CET 2023 upgrade: Sending signal KILL to hostapd (1780)
Sat Jan 28 11:49:19 CET 2023 upgrade: Sending signal KILL to hostapd (1780)
Sat Jan 28 11:49:19 CET 2023 upgrade: Sending signal KILL to hostapd (1780)
Sat Jan 28 11:49:19 CET 2023 upgrade: Sending signal KILL to hostapd (1780)
Sat Jan 28 11:49:19 CET 2023 upgrade: Sending signal KILL to hostapd (1780)
Sat Jan 28 11:49:19 CET 2023 upgrade: Sending signal KILL to hostapd (1780)
Sat Jan 28 11:49:19 CET 2023 upgrade: Failed to kill all processes.
sysupgrade aborted with return code: 256
[  369.195614] ath11k c000000.wifi: failed to flush transmit queue, data pkts pending 3
[  369.649251] remoteproc remoteproc0: stopped remote processor cd00000.q6v5_wcss
[  370.175859] reboot: Restarting system

Sometimes even the inability to kill the hostapd process due to the ath11k bug leads to a kernel panic.

- watchdog -
Watchdog did not previously reset the system
Sat Jan 28 13:48:18 CET 2023 upgrade: Sending TERM to remaining processes ...
[ 4021.020044] device phy1-ap0 left promiscuous mode
[ 4021.020172] br-lan: port 7(phy1-ap0) entered disabled state
Sat Jan 28 13:48:18 CET 2023 upgrade: Sending signal TERM to hostapd (1741)
Sat Jan 28 13:48:18 CET 2023 upgrade: Sending signal TERM to hostapd (1751)
Sat Jan 28 13:48:18 CET 2023 upgrade: Sending signal TERM to netserver (1972)
Sat Jan 28 13:48:22 CET 2023 upgrade: Sending KILL to remaining processes ...
Sat Jan 28 13:48:22 CET 2023 upgrade: Sending signal KILL to hostapd (1741)
Sat Jan 28 13:48:22 CET 2023 upgrade: Sending signal KILL to hostapd (1751)
Sat Jan 28 13:48:22 CET 2023 upgrade: Sending signal KILL to hostapd (1751)
Sat Jan 28 13:48:22 CET 2023 upgrade: Sending signal KILL to hostapd (1751)
Sat Jan 28 13:48:22 CET 2023 upgrade: Sending signal KILL to hostapd (1751)
Sat Jan 28 13:48:22 CET 2023 upgrade: Sending signal KILL to hostapd (1751)
Sat Jan 28 13:48:22 CET 2023 upgrade: Sending signal KILL to hostapd (1751)
Sat Jan 28 13:48:22 CET 2023 upgrade: Sending signal KILL to hostapd (1751)
Sat Jan 28 13:48:22 CET 2023 upgrade: Sending signal KILL to hostapd (1751)
Sat Jan 28 13:48:22 CET 2023 upgrade: Sending signal KILL to hostapd (1751)
Sat Jan 28 13:48:22 CET 2023 upgrade: Sending signal KILL to hostapd (1751)
Sat Jan 28 13:48:22 CET 2023 upgrade: Failed to kill all processes.
sysupgrade aborted with return code: 256
[ 4026.329597] ath11k c000000.wifi: failed to flush transmit queue, data pkts pending 4
[ 4026.422566] br-lan: port 8(phy2-ap0) entered disabled state
[ 4026.700723] br-lan: port 8(phy2-ap0) entered disabled state
[ 4026.702222] device phy2-ap0 left promiscuous mode
[ 4026.705112] br-lan: port 8(phy2-ap0) entered disabled state
[ 4026.917369] remoteproc remoteproc0: stopped remote processor cd00000.q6v5_wcss
[ 4026.917418] ------------[ cut here ]------------
[ 4026.923486] Have pending ack frames!
[ 4026.928292] WARNING: CPU: 1 PID: 1 at ieee80211_alloc_hw_nm+0x754/0x900 [mac80211]
[ 4026.931821] Modules linked in: pppoe ppp_async nft_fib_inet nf_flow_table_ipv6 nf_flow_table_ipv4 n  f_flow_table_inet ath11k_pci ath11k_ahb ath11k pppox ppp_generic nft_reject_ipv6 nft_reject_ipv4 nft_r  eject_inet nft_reject nft_redir nft_quota nft_objref nft_numgen nft_nat nft_masq nft_log nft_limit nft  _hash nft_flow_offload nft_fib_ipv6 nft_fib_ipv4 nft_fib nft_ct nft_counter nft_chain_nat nf_tables nf  _nat nf_flow_table nf_conntrack mac80211 cfg80211 ums_usbat ums_sddr55 ums_sddr09 ums_karma ums_jumpsh  ot ums_isd200 ums_freecom ums_datafab ums_cypress ums_alauda tmp103 slhc rfcomm regmap_i2c qrtr_smd qr  tr_mhi qrtr qmi_helpers ns nfnetlink nf_reject_ipv6 nf_reject_ipv4 nf_log_syslog nf_defrag_ipv6 nf_def  rag_ipv4 mhi libcrc32c hwmon hidp hci_uart crc_ccitt compat btusb btrtl btintel bnep bluetooth ntfs3 h  id evdev input_core msdos autofs4 dns_resolver nls_utf8 nls_iso8859_15 nls_iso8859_1 nls_cp850 nls_cp4  37 nls_cp1250 ecdh_generic ecc seqiv jitterentropy_rng drbg michael_mic kpp hmac cmac
[ 4026.931963]  uas usb_storage leds_gpio xhci_plat_hcd xhci_pci xhci_hcd dwc3 dwc3_qcom qca_nss_dp qc  a_ssdk ramoops reed_solomon pstore gpio_button_hotplug vfat fat ext4 mbcache jbd2 exfat crc32c_generic
[ 4027.026635] CPU: 1 PID: 1 Comm: upgraded Not tainted 5.15.90 #0
[ 4027.044403] Hardware name: Zyxel NBG7815 (DT)
[ 4027.050131] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 4027.054648] pc : ieee80211_alloc_hw_nm+0x754/0x900 [mac80211]
[ 4027.061417] lr : ieee80211_alloc_hw_nm+0x754/0x900 [mac80211]
[ 4027.067321] sp : ffffffc008bcbb40
[ 4027.073046] x29: ffffffc008bcbb40 x28: ffffff8001cb0000 x27: ffffff8002447490
[ 4027.076351] x26: 0000000000000000 x25: ffffffc008b68030 x24: ffffff8006759fb0
[ 4027.083469] x23: 0000000000000000 x22: 000000007fffffff x21: ffffffc000d3c790
[ 4027.090587] x20: 0000000000000000 x19: ffffff80151ac500 x18: ffffffc008aa79c0
[ 4027.097705] x17: 63775f357636712e x16: 3030303030646320 x15: 0000000000000534
[ 4027.104823] x14: 00000000000001bc x13: ffffffc008bcb868 x12: ffffffc008aff9c0
[ 4027.111941] x11: 0000000000000004 x10: ffffffc008aff9c0 x9 : 0000000000000000
[ 4027.119059] x8 : ffffffc008aa7970 x7 : ffffffc008aa79c0 x6 : 00000000ffffefff
[ 4027.126177] x5 : ffffffc008aff9c0 x4 : 00000000ffffefff x3 : 0000000000000001
[ 4027.133296] x2 : ffffffc008aa7920 x1 : ffffffc008aa7920 x0 : 0000000000000018
[ 4027.140415] Call trace:
[ 4027.147523]  ieee80211_alloc_hw_nm+0x754/0x900 [mac80211]
[ 4027.149786]  idr_for_each+0x58/0xc0
[ 4027.155336]  ieee80211_free_hw+0x40/0xb0 [mac80211]
[ 4027.158638]  ath11k_mac_destroy+0x44/0x70 [ath11k]
[ 4027.163498]  ath11k_core_deinit+0xa4/0x444 [ath11k]
[ 4027.168361]  0xffffffc000b38988
[ 4027.173131]  platform_shutdown+0x24/0x34
[ 4027.176258]  device_shutdown+0x148/0x250
[ 4027.180425]  __do_sys_reboot+0x1dc/0x260
[ 4027.184331]  __arm64_sys_reboot+0x24/0x30
[ 4027.188237]  invoke_syscall.constprop.0+0x5c/0x104
[ 4027.192144]  do_el0_svc+0x6c/0x15c
[ 4027.196829]  el0_svc+0x18/0x54
[ 4027.200213]  el0t_64_sync_handler+0xe8/0x114
[ 4027.203256]  el0t_64_sync+0x184/0x188
[ 4027.207682] ---[ end trace 47857f62d6378d02 ]---
[ 4027.839787] reboot: Restarting system

To better understand the process, below I put the log when the sysupgrade process is done without problems.

Watchdog handover: fd=3
- watchdog -
Watchdog did not previously reset the system
Sat Jan 28 13:59:21 CET 2023 upgrade: Sending TERM to remaining processes ...
Sat Jan 28 13:59:22 CET 2023 upgrade: Sending signal TERM to hostapd (1744)
Sat Jan 28 13:59:22 CET 2023 upgrade: Sending signal TERM to hostapd (1760)
Sat Jan 28 13:59:22 CET 2023 upgrade: Sending signal TERM to netserver (1976)
Sat Jan 28 13:59:22 CET 2023 upgrade: Sending signal TERM to avahi-daemon (2140)
[  318.362670] device phy2-ap0 left promiscuous mode
[  318.362791] br-lan: port 8(phy2-ap0) entered disabled state
[  318.662570] device phy1-ap0 left promiscuous mode
[  318.662676] br-lan: port 9(phy1-ap0) entered disabled state
Sat Jan 28 13:59:26 CET 2023 upgrade: Sending KILL to remaining processes ...
[  328.440827] stage2 (4727): drop_caches: 3
Sat Jan 28 13:59:32 CET 2023 upgrade: Switching to ramdisk...
Sat Jan 28 12:59:33 UTC 2023 upgrade: Performing system upgrade...
flashing kernel to /dev/mmcblk0p7
flashing rootfs to /dev/mmcblk0p8
[  330.954889] loop0: detected capacity change from 0 to 79360
Format new rootfs_data at position 22282240.
mke2fs 1.46.5 (30-Dec-2021)
Creating filesystem with 39680 1k blocks and 9920 inodes
Filesystem UUID: dbac27fb-5038-43fc-b222-e6ecacdbf124
Superblock backups stored on blocks:
        8193, 24577

Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

[  331.838143] EXT4-fs (loop0): mounted filesystem with ordered data mode. Opts: (null). Quota mode: disabled.
Saving config to rootfs_data at position 22282240.
umount: can't unmount /dev: Resource busy
umount: can't unmount /tmp: Resource busy
[  332.561920] remoteproc remoteproc0: stopped remote processor cd00000.q6v5_wcss
[  333.072680] reboot: Restarting system
1 Like

Well, yeah, its been known for a while, basically TX flushing fails and then you have to wait for it to timeout which takes longer than the timeout that sysupgrade expects.

We suspect that ath11k is miscounting the packets and therefore wants to flush the packets that have already left the radio

2 Likes

As a newbie I'd like to ask what the task would be. To get the leds working. I like the colors:-)
One has to compile this packge package/kernel: add support for TI LP55XX LED controllers commons · ddimension/openwrt@c91c0aa · GitHub as explained here (https://openwrt.org/docs/guide-developer/toolchain/single.package) and then add it to the image with imagebuilder. I don't now if could do it but I would try:-)

You need to compile the full ddimension firmware

So you have to do

/etc/init.d/wpad stop

and wait a bit before you update.
Personally I do that with all running services (except dropbear and netifd) before I sysupgrade. Just to make sure it succeeds.

1 Like

I knew that this problem existed with the Xiaomi ax3600, but no one had complained about this problem with this router.
i'll try next time.

Thank you for your answer!