OpenWrt Support for Armor G5 (NBG7815)

For mi it's working. Short push made a reboot.

AFAIK the serial is a must to stop autoboot. See the following link that explains how to do it
Debricking Armor G5

I have personally measured the rxd-gnd voltage and it is 3.3 volts

O. K. I did test again. I had to press the button longer to make it reboot. ~ 4 sec. for reboot and ~ 8 sec. for reset.

Mybe I'm wrong but my thought was it to do the same as flashing OpenWrt on it (without serial). Just reverse. So rootfs and kernel. In addition to that I would need to "dd" wififw also because I know I've installed v8 as latest fw installed and would flash v7 or v6 because thats the only I have. I just don't know for what the zloader.bin is and if "reverse dd" is working.

That sounds good did you connect a serial USB adapter with 3.3 volts or just measured?

I've done both

1 sec was enough for me.

So far no one has done it. If you see yourself with the strength to try it... more than one will be grateful to you!!! I don't have the skill to even try it.

1 Like

While I did not stop time. 1 sec. is way to short from my point of view. But as it is working I don't want discuss seconds. It was just my fault and it might be that I just pressed beyond the switch.

While you confirmed 3,3V is working I will try it at a later time propably. I just have to get into this device. Especially the partitioning, looking into their own upgrade procedure and doing a proper backup of all partitions. But in theory it should work if they do not write something hidden into the partitions during their upgrade process.

1 Like

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:

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