OpenWrt Support for Armor G5 (NBG7815)

I can confirm this (after boot in logread): Removed the log snippset.

EDIT: I've grabbed your latest DTS file from 13-12-2022 and added blockd (pulling autofs and block-mount). Everything is fine now. Wifi is comming up every reboot no matter if a device is present or not. No error message anymore.

I made a script to change active partition, so you can go back to the original firmware

Try this:

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

Tested on my device :slight_smile:

3 Likes

Ty, I will try it druing christmas holidays (if I can).

I've updated to lastest dts but wifi problem still present for me.

Wed Dec 14 08:39:34 2022 daemon.notice netifd: radio2 (2551): WARNING: Variable 'data' does not exist or is not an array/object
Wed Dec 14 08:39:34 2022 daemon.notice netifd: radio2 (2551): Bug: PHY is undefined for device 'radio2'
Wed Dec 14 08:39:34 2022 daemon.notice netifd: Wireless device 'radio2' is now down
Wed Dec 14 08:39:34 2022 daemon.notice netifd: radio0 (2563): WARNING: Variable 'data' does not exist or is not an array/object
Wed Dec 14 08:39:34 2022 daemon.notice netifd: radio0 (2563): Bug: PHY is undefined for device 'radio0'
Wed Dec 14 08:39:34 2022 daemon.notice netifd: Wireless device 'radio0' is now down
Wed Dec 14 08:39:34 2022 daemon.notice netifd: radio1 (2561): WARNING: Variable 'data' does not exist or is not an array/object
Wed Dec 14 08:39:34 2022 daemon.notice netifd: radio1 (2561): Bug: PHY is undefined for device 'radio1'
Wed Dec 14 08:39:34 2022 daemon.notice netifd: Wireless device 'radio1' is now down

On the other side, file sharing performance are awesome. 140-150 MB/sec. with new ntfs3 filesystem dirver and with exfat filesystem. vfat is around 100 MB/sec. Overall CPU usage on all case about 60%

Hmm, the DTS file should not be the culprit here. Because I've patched mine by myself before. I've just mentioned it to indicate that USB is working with it.

On my first attempt I just put it into my config to test if USB is working (normally I do not use USB on routers). I realized that block-mount is not enough/outdated approach. --> blockd to pull everything needed.

CONFIG_PACKAGE_blockd=y
CONFIG_PACKAGE_mount-utils=y

While blockd is pulling some extra libs including block-mount/autofs as well.

For reference:

CONFIG_PACKAGE_usbutils=y
CONFIG_PACKAGE_kmod-usb-core=y
CONFIG_PACKAGE_kmod-kmod-usb3=y
CONFIG_PACKAGE_kmod-usb-dwc3=y
CONFIG_PACKAGE_kmod-usb-dwc3-qcom=y
CONFIG_PACKAGE_kmod-usb-storage=y
CONFIG_PACKAGE_luci-app-hd-idle=y

I'm sure you can drop "CONFIG_PACKAGE_kmod-kmod-usb3=y" here also. Just forgot it but left it here for reference in case I'm wrong.

I didn't test speed or so just put into an usb3 drive and forgot to remove it. After ~1 hour the fan started to make horrible noise. Any possibility to adjust the fan speed. I guess not. :smiley:

Reference is it ist ath11k for the fan. While there are three values for it.

root@NBG8715:~# sensors
ath11k_hwmon-isa-c000000
Adapter: ISA adapter
temp1:        +62.0°C

tmp103-i2c-0-70
Adapter: QUP I2C adapter
temp1:        +60.0°C  (low  = -10.0°C, high = +60.0°C)

ath11k_hwmon-isa-c000000
Adapter: ISA adapter
temp1:        +78.0°C

ath11k_hwmon-isa-c000000
Adapter: ISA adapter
temp1:        +58.0°C

Change your fan temperatures by uci as:

fanctld.config.TempTrig='80000'
fanctld.config.TempClr='75000'

It will helps a lot :slight_smile:

2 Likes

I installed latest build to 2022-12-15-0153. Commands not working.

image

The fan started in at the following values.

Stopped this values.

Try

uci option set fanctld.config.TempTrig='80000'
uci option set fanctld.config.TempClr='75000'
uci commit fancltd

PD: @sahindirek put in next post working uci command to change fan control temp.

3 Likes

It worked like this. I'm monitoring sensor temperatures and fan status.

Thanks.

uci set fanctld.config.TempTrig='80000'
uci set fanctld.config.TempClr='75000'
uci commit fancltd
1 Like

I was playing a bit with bluetooth:

root@NBG8715:~# rfkill list

0: phy0: wlan
        Soft blocked: no
        Hard blocked: no
1: phy1: wlan
        Soft blocked: no
        Hard blocked: no
2: phy2: wlan
        Soft blocked: no
        Hard blocked: no

root@NBG8715:~# bluetoothctl list

So the built-in bluetooth is not exposed to the OS it seems.

If I insert an external USB BT stick I get:

root@NBG8715:~# rfkill list

0: phy0: wlan
        Soft blocked: no
        Hard blocked: no
1: phy1: wlan
        Soft blocked: no
        Hard blocked: no
2: phy2: wlan
        Soft blocked: no
        Hard blocked: no
3: hci0: bluetooth
        Soft blocked: no
        Hard blocked: no

root@NBG8715:~# bluetoothctl list
Controller 00:19:86:00:00:00 BlueZ 5.64 [default]

root@NBG8715:~# bluetoothctl
Agent registered
[CHG] Controller 00:19:86:00:00:00 Pairable: yes
[bluetooth]# scan on
Failed to start discovery: org.bluez.Error.NotReady

From there I don't know how to dig further. Because it this indicates sth. other is wrong. I could imagine a conflict with DBUS and UBUS. Or lacking firmware for the device itself.

While this is a nice to have feature because Bluetooth Tethering is less power consuming I would not insist to make it work.

I've digged up this which makes me think it could be more complicated to get BT working:

1 Like

You're right, in the lastest build problem exists,
after reboot radio devices needs restart manually.

The problem is with blockd package -> probing pci controller causes disable wifi devices

Someone fix this in mediatek devices by adding delay to detect ports:

1 Like

I did a reset of the device a few minutes ago to test again. Wifi is not comming up after a reset. But if I reboot the unit everything is fine. I've rebootet 5 times. Everything is fine.
But it is an annoying bug. Would sth. change if we drop kmod-ath11k-pci? We don't have pci card slots for wifi cards on this device. I will give it a try and report back.

EDIT: Does not change anything. :smiley:

I have discovered another bug with the wifi network if we have the block-mount package installed either in isolation or as a dependency on other packages (blockd...).
Once the radios are enabled after the reboot, the radios can no longer be deactivated through the LUCI menu although it gives us the message that the radio is deactivated but using any device we can check the radio is up and we can connect to it .

this is what system.log say about it.

Thu Dec 15 20:25:04 2022 kern.info kernel: [  648.433237] device phy1-ap0 left promiscuous mode
Thu Dec 15 20:25:04 2022 kern.info kernel: [  648.433408] br-lan: port 7(phy1-ap0) entered disabled state
Thu Dec 15 20:25:04 2022 daemon.notice netifd: radio1 (5707): WARNING: Variable 'data' does not exist or is not an array/object
Thu Dec 15 20:25:04 2022 daemon.notice netifd: radio1 (5707): Bug: PHY is undefined for device 'radio1'
Thu Dec 15 20:25:04 2022 daemon.notice netifd: Wireless device 'radio1' is now down

It seems phy1-ap0 on radio1 to be down but....

Thu Dec 15 20:26:12 2022 daemon.notice hostapd: phy1-ap0: AP-STA-DISCONNECTED xx:xx:xx:05:16:e9
Thu Dec 15 20:26:34 2022 daemon.info hostapd: phy1-ap0: STA xx:xx:xx:05:16:e9 IEEE 802.11: authenticated
Thu Dec 15 20:26:34 2022 daemon.info hostapd: phy1-ap0: STA xx:xx:xx:05:16:e9 IEEE 802.11: associated (aid 1)
Thu Dec 15 20:26:34 2022 daemon.notice hostapd: phy1-ap0: AP-STA-CONNECTED xx:xx:xx:05:16:e9 auth_alg=open
Thu Dec 15 20:26:34 2022 daemon.info hostapd: phy1-ap0: STA xx:xx:xx:05:16:e9 WPA: pairwise key handshake completed (RSN)
Thu Dec 15 20:26:34 2022 daemon.notice hostapd: phy1-ap0: EAPOL-4WAY-HS-COMPLETED xx:xx:xx:05:16:e9
Thu Dec 15 20:27:01 2022 daemon.notice hostapd: phy1-ap0: AP-STA-DISCONNECTED xx:xx:xx:05:16:e9
Thu Dec 15 20:27:29 2022 daemon.err hostapd: nl80211: kernel reports: key addition failed
Thu Dec 15 20:27:33 2022 daemon.info hostapd: phy1-ap0: STA xx:xx:xx:6d:a1:8e IEEE 802.11: authenticated
Thu Dec 15 20:27:33 2022 daemon.info hostapd: phy1-ap0: STA xx:xx:xx:6d:a1:8e IEEE 802.11: associated (aid 1)
Thu Dec 15 20:27:33 2022 daemon.notice hostapd: phy1-ap0: AP-STA-CONNECTED xx:xx:xx:6d:a1:8e auth_alg=open
Thu Dec 15 20:27:33 2022 daemon.info hostapd: phy1-ap0: STA xx:xx:xx:6d:a1:8e WPA: pairwise key handshake completed (RSN)
Thu Dec 15 20:27:33 2022 daemon.notice hostapd: phy1-ap0: EAPOL-4WAY-HS-COMPLETED xx:xx:xx:6d:a1:8e

When the block-mount package is not installed if we disable the same radio the result is as follow:

Thu Dec 15 19:53:23 2022 kern.info kernel: [ 3090.327245] device phy1-ap0 left promiscuous mode
Thu Dec 15 19:53:23 2022 kern.info kernel: [ 3090.327418] br-lan: port 9(phy1-ap0) entered disabled state
Thu Dec 15 19:53:23 2022 daemon.notice hostapd: Remove interface 'phy1-ap0'
Thu Dec 15 19:53:23 2022 daemon.notice hostapd: phy1-ap0: interface state ENABLED->DISABLED
Thu Dec 15 19:53:23 2022 daemon.notice hostapd: phy1-ap0: AP-STA-DISCONNECTED xx:xx:xx:af:8f:7d
Thu Dec 15 19:53:24 2022 daemon.notice hostapd: phy1-ap0: AP-STA-DISCONNECTED xx:xx:xx:05:16:e9
Thu Dec 15 19:53:24 2022 daemon.notice hostapd: phy1-ap0: AP-DISABLED
Thu Dec 15 19:53:24 2022 daemon.notice hostapd: phy1-ap0: CTRL-EVENT-TERMINATING
Thu Dec 15 19:53:24 2022 daemon.err hostapd: rmdir[ctrl_interface=/var/run/hostapd]: Permission denied

1 Like

BTW.

I've upgraded script to change active boot partitions between zyxel original to openwrt and vice versa.
Using this script you can switch anytime you want between Openwrt's.

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

2 Likes

I have a really hard time to reproduce this. I've installed blockd with block-mount. Everything is working. I can disable, enable wifi, reboot devices are comming back.
If I install block-mount only (without blockd and kmod-fs-autofs4). I have the same issues like you.

What I've observed with block-mount only that overlay is fucked up. Which explains why things are not working. You cannot save anything anymore.

root@NBG8715:~# mount
/dev/mmcblk0p8 on /rom type squashfs (ro,relatime,errors=continue)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/mmcblk0p8 on /overlay type ext4 (rw,noatime)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work,xino=off)
tmpfs on /dev type tmpfs (rw,nosuid,noexec,noatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,noatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
bpffs on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,noatime,mode=700)
mountd(pid2856) on /tmp/run/blockd type autofs (rw,relatime,fd=7,pgrp=2856,timeout=30,minproto=5,maxproto=5,indirect)

root@NBG8715:~# mount
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work,xino=off)
tmpfs on /dev type tmpfs (rw,nosuid,noexec,noatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,noatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
bpffs on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,noatime,mode=700)
mountd(pid4303) on /tmp/run/blockd type autofs (rw,relatime,fd=7,pgrp=4303,timeout=30,minproto=5,maxproto=5,indirect)

Maybe we can workaround this. E. g. ensure in an early stage overlay is mounted propberly.

I've started from scratch and I've built a firmware that only includes, in addition to packages automatically selected for this device, the blockd package.
I have flashed without saving configuration.
Every time I reboot I still don't get wifi.

Or by further delaying the loading of block-mount package which seems to be preventing mmcblk0p8 unmounting

 BusyBox v1.35.0 (2022-12-15 14:58:05 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r21554-c32d7f6fc9
 -----------------------------------------------------
root@NBG7815:~#  opkg list-installed | grep -e block -e auto
block-mount - 2022-11-10-3affe9ea-1
blockd - 2022-11-10-3affe9ea-1
kmod-fs-autofs4 - 5.15.82-1
root@NBG7815:~#  mount
/dev/mmcblk0p8 on /rom type squashfs (ro,relatime,errors=continue)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/mmcblk0p8 on /overlay type ext4 (rw,noatime)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work,xino=off)
tmpfs on /dev type tmpfs (rw,nosuid,noexec,noatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,noatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
bpffs on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,noatime,mode=700)
mountd(pid1978) on /tmp/run/blockd type autofs (rw,relatime,fd=7,pgrp=1978,timeout=30,minproto=5,maxproto=5,indirect)
root@NBG7815:~#

1 Like

Yes this was my first thought too. But this is not reliable and can only be an individual solution. My thought/guess is that I'm just lucky that /rom is mounted exactly then if it is needed to read the wifi firmware files (I've installed some extra software which may delay things). Because it is /rom which is delayed in mounting or un-mounted and re-mounted later (didn't investigate) what is happening exactly.

I don't have time today to dig further. But we have in /etc/config/fstabe some options which could help or we could play with.

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        '0'

Delay for root to 0?

For all others are entries but all with '0' for automount. Maybe set them to '1' for /rom and /overlay?

config 'mount'
        option  target  '/rom'
        option  uuid    'f05c68e7'
        option  enabled '0'

config 'mount'
        option  target  '/overlay'
        option  uuid    '07627dd'
        option  enabled '0'

EDIT: Maybe it helps to get some glue (I've removed the 1st part which is always the same on all devices (I guess):

[   12.221565] block: attempting to load /etc/config/fstab
[   12.223273] block: unable to load configuration (fstab: Entry not found)
[   12.225889] block: no usable configuration
[   12.233066] loop0: detected capacity change from 0 to 122880
[   12.303739] loop0: detected capacity change from 122880 to 50304
[   12.363542] EXT4-fs (loop0): recovery complete
[   12.364167] EXT4-fs (loop0): mounted filesystem with ordered data mode. Opts: (null). Quota mode: disabled.
[   12.368459] mount_root: loading kmods from internal overlay
[   12.386585] kmodloader: loading kernel modules from /tmp/overlay/upper/etc/modules-boot.d/*
[   12.386953] kmodloader: done loading kernel modules from /tmp/overlay/upper/etc/modules-boot.d/*
[   13.699553] block: attempting to load /etc/config/fstab
[   13.699625] block: unable to load configuration (fstab: Entry not found)
[   13.703603] block: no usable configuration
[   13.711080] mount_root: switching to ext4 overlay
[   13.716655] overlayfs: null uuid detected in lower fs '/', falling back to xino=off,index=off,nfs_export=off.
[   13.720808] urandom-seed: Seeding with /etc/urandom.seed
[   14.392457] procd: - early -
[   14.392545] procd: - watchdog -
[   14.942431] procd: - watchdog -
[   14.943255] procd: - ubus -
[   14.997857] procd: - init -
[   15.214896] urngd: v1.0.2 started.
[   15.268787] kmodloader: loading kernel modules from /etc/modules.d/*
[   15.300421] NET: Registered PF_ALG protocol family
[   15.320703] Key type dns_resolver registered
[   15.327517] Key type cifs.idmap registered
[   15.332187] tun: Universal TUN/TAP device driver, 1.6
[   15.338232] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[   15.341580] nat46: module (version 95ca1c3b99376da2d0306919f2df4a8d3c9bb78b) loaded.
[   15.345982] gre: GRE over IPv4 demultiplexor driver
[   15.351939] ip_gre: GRE over IPv4 tunneling driver
[   15.357913] ip6_gre: GRE over IPv6 tunneling driver
[   15.367724] hid: raw HID events driver (C) Jiri Kosina
[   15.368685] GACT probability on
[   15.372558] Mirror/redirect action on
[   15.380272] u32 classifier
[   15.380309]     input device check on
[   15.381883]     Actions configured
[   15.391283] ntfs3: Max link count 4000
[   15.391319] ntfs3: Enabled Linux POSIX ACLs support
[   15.400324] Bluetooth: Core ver 2.22
[   15.400455] NET: Registered PF_BLUETOOTH protocol family
[   15.402990] Bluetooth: HCI device and connection manager initialized
[   15.408327] Bluetooth: HCI socket layer initialized
[   15.414684] Bluetooth: L2CAP socket layer initialized
[   15.419236] Bluetooth: SCO socket layer initialized
[   15.425449] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   15.429118] Bluetooth: BNEP filters: protocol multicast
[   15.434693] Bluetooth: BNEP socket layer initialized
[   15.442582] usbcore: registered new interface driver btusb
[   15.445531] Loading modules backported from Linux version v6.1-rc8-0-g76dcd734eca2
[   15.450128] Backport generated by backports.git v5.15.81-1-41-g02e352527db5
[   15.459167] Bluetooth: HCI UART driver ver 2.3
[   15.464545] Bluetooth: HCI UART protocol H4 registered
[   15.469046] Bluetooth: HCI UART protocol BCSP registered
[   15.475164] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[   15.479649] Bluetooth: HIDP socket layer initialized
[   15.501385] NET: Registered PF_QIPCRTR protocol family
[   15.504602] Bluetooth: RFCOMM TTY layer initialized
[   15.505446] Bluetooth: RFCOMM socket layer initialized
[   15.510230] Bluetooth: RFCOMM ver 1.11
[   15.529571] xt_time: kernel timezone is -0000
[   15.583559] PPP generic driver version 2.4.2
[   15.584469] PPP MPPE Compression module registered
[   15.587798] NET: Registered PF_PPPOX protocol family
[   15.592333] PPTP driver version 0.8.5
[   15.598464] wireguard: WireGuard 1.0.0 loaded. See www.wireguard.com for information.
[   15.600187] wireguard: Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
[   15.615436] ath11k c000000.wifi: ipq8074 hw2.0
[   15.617771] remoteproc remoteproc0: powering up cd00000.q6v5_wcss
[   15.630933] remoteproc remoteproc0: Booting fw image IPQ8074/q6_fw.mdt, size 668
[   16.364891] remoteproc remoteproc0: remote processor cd00000.q6v5_wcss is now up
[   16.370372] kmodloader: done loading kernel modules from /etc/modules.d/*
[   16.408811] ath11k c000000.wifi: qmi ignore invalid mem req type 3
[   16.416270] ath11k c000000.wifi: chip_id 0x0 chip_family 0x0 board_id 0xff soc_id 0xffffffff
[   16.416313] ath11k c000000.wifi: fw_version 0x270204a5 fw_build_timestamp 2022-08-04 13:05 fw_build_id WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
1 Like

Edited because the problem seems to be different.

can this router benefit of "luci-app-advanced-reboot" ?

1 Like

There's posibility to add this router to that package, but it need some additional codes to support bootconfig.

1 Like