OpenWrt Support for Armor G5 (NBG7815)

For the temperature sensors you need to add kmod-hwmon-tmp103 to the default packages

also (from checking your tree) for bluetooth dont modify the kernel config, there are already kmod packages(kmod-bluetooth) for bluetooth but i dont think ath11k has bluetooth coexistence in the driver

2 Likes

Dear sir
i use ttl connect NBG7815
it show NBG7815>
how can i change to root@NBG7815#
tks

It is explained in detail here.

1 Like

Dear altuntepe:

When i press f

etc folder do not have
openwrt_release file

If i keyin passwd ,it show root password do not changed

How to change root passwd

If i enter

tftpboot 0x44000000 192.168.1.99:openwrt-ipq807x-generic-zyxel_nbg7815-initramfs-fit-uImage.itb && bootm

It show do not know tftpboot command.

Is there any Tutorial

Thanks a lot

What to do from the beginning with stock software installed on the device:

1- Disconnect all LAN/WAN cables from the device.
2- Press and hold the reset button until the orange light
3- After about 5 minutes, the led will turn dark blue.
4- Now plug in the lan cable, make a Telnet connection with Putty to 192.168.123.1. (port 23)
5- It will ask for username: root
Password: nbg7815@2019 (copy and paste with right mouse click)
6- now copy and paste the following commands one by one in the same way:

uci set dropbear.setting.enable=1
uci commit dropbear
uci set network.general.auto_ip_change=0
uci commit network

After entering the command below, we will add # in front of the required parts as in the picture.

vi /etc/init.d/preboot

ss

*** To add #, press the i key after entering the above command. Use the arrow keys and add # to the required parts. Press ESC after adding them all. Then type :w and press enter. Exit edit mode by pressing CTRL+Z. For process control, you can enter vi /etc/init.d/preboot command again and check. ***
7- Unplug the device and plug it back in and start again. Congratulations, you can now connect to the device with Putty (SSH) and WinSCP (SCP). We typed the username and password in the previous commands, it's the same.

8- Now let's move on to the Openwrt installation.
9- Enter the commands below, then take your backups to your computer with WinSCP.

mkdir /tmp/ApplicationData/backup
mkdir /tmp/ApplicationData/openwrt
dd if=/dev/mmcblk0p7 of=/tmp/ApplicationData/backup/hlos_blk0p7.bin
dd if=/dev/mmcblk0p8 of=/tmp/ApplicationData/backup/rootfs_blk0p8.bin

10- Extract the "kernel" and "root" files with 7zip from the openwrt.bin file, and put them in the /tmp/ApplicationData/openwrt folder of the device with WinSCP.
11- Install openwrt on the device by entering the following commands:

dd if=/dev/zero of=/dev/mmcblk0p7
dd if=/tmp/ApplicationData/openwrt/kernel of=/dev/mmcblk0p7
    
dd if=/dev/zero of=/dev/mmcblk0p8 
dd if=/tmp/ApplicationData/openwrt/root of=/dev/mmcblk0p8

12- Unplug the device and plug it in, Openwrt is installed.
**There is no Luci web interface, so you cannot access it from 192.168.1.1. Edit the network file with WinSCP, after connecting the device to the internet, you can install the Luci interface by entering the following commands with Putty:

opkg update
opkg install luci

thanks @itorK All the work belongs to him.

1 Like

thanks altuntepe
i'll try it ,tomorrow

(do u use openwrt-ipq807x-zyxel nbg6817-sysupgrade.bin of @itorK )

I've added temp103 module to repository and fan control.

For fan default values are:

root@OpenWrt:~# uci show fanctld
fanctld.config=fanctld
fanctld.config.Enabled='1'
fanctld.config.Delay='20'
fanctld.config.Hits='3'
fanctld.config.TempTrig='73000'
fanctld.config.TempClr='68000'

Fan is enabled where temperature reach 73 degrees on minimum one sensor and stops where temp lower then 68 on all sensors.

Simply test:

fanctl start
fanctl stop

I noticed that there's diffrence with GPIO fan pin on stock firmware vs openwrt.
stock firmware -> GPIO PIN 21
Openwrt -> GPIO PIN 430

Why is GPIO so high at ours openwrt?

3 Likes

One issue on your tree, you added the TMP103 package to the target default packages not the device packages

For the bluetooth chip you need to add

&blsp1_uart3 {
	status = "okay";
}

With the fan GPIOs your DTS probably needs a mux to fix it, this was in the zyxel gpl DTS

	GPIO 21 and 22 - enable FAN1 and FAN22
	GPIO 25 and 26 - read RPM from FAN
	GPIO 31 - QCA8081 reset
	GPIO 32 - USB1_EN
	GPIO 37 - QCA8075 reset
	GPIO 54 - RESET BUTTON
	GPIO 59 - QCA8081 Interrupt
	GPIO 60 - LED enable - LED enable to LED board
	gpio_pins: gpio_pinmux {
		mux_1 {
			pins = "gpio21", "gpio22", "gpio32", "gpio31", "gpio37", "gpio60";
			function = "gpio";
			drive-strength = <2>;
				output-high;
				bias-disable;
		};
		mux_2 {
			pins = "gpio25", "gpio26", "gpio44", "gpio54", "gpio59";
			function = "gpio";
				input-enable;
				bias-disable;
		};
	}; 
1 Like

Claryfication -> Fan is working without problems(GPIO PIN is correct), but problem is with the huge range of GPIO

GPIO chip 200f000.spmi:pmic@0:gpio@c000 starts from GPIOs 430 and fan is at 463

root@OpenWrt:/sys/class/gpio# ls
export       gpio463      gpiochip430  gpiochip442  unexport

with stock firmware fan is at gpio21

BTW. gpio_pinmux is supported only in stock firmware

EDIT: Ok, I got it, driver in stock firmware has been customized and set base to 0 instead -1

1 Like

tanks a lot

thanks altuntepe , @itorK
with ur help i have install opnwrt in nbg7815
but there some errors show

when i run opkg update

*** Failed to download the package list from https://downloads.openwrt.org/snapshots/targets/ipq807x/generic/packages/Packages.gz
opkg_download: Failed to download https://downloads.openwrt.org/snapshots/targets/ipq807x/generic/packages/Packages.gz, wget returned 8.

then i run opkg install luci

Collected errors:
 * pkg_hash_check_unresolved: cannot find dependency libip4tc2 for firewall
 * pkg_hash_check_unresolved: cannot find dependency libip6tc2 for firewall
 * pkg_hash_check_unresolved: cannot find dependency libiptext0 for firewall
 * pkg_hash_check_unresolved: cannot find dependency libiptext6-0 for firewall
 * pkg_hash_check_unresolved: cannot find dependency libxtables12 for firewall
 * pkg_hash_check_unresolved: cannot find dependency kmod-ipt-core for firewall
 * pkg_hash_check_unresolved: cannot find dependency kmod-ipt-conntrack for firewall
 * pkg_hash_check_unresolved: cannot find dependency kmod-ipt-nat for firewall

some package can't find

          yauger

That's expected. ipq807x support is not merged into OpenWrt proper yet, meaning there are no ipq807x target specific package repositories yet - and as with all other custom/ community builds, the kernel module dependencies are unique and not fullfilled by the official repos anyways.

If you want to install (target-/ kernel specific) features, you will need to build them (and everything else you may want) from source yourself (directly into your own sysupgrade images) - or wait for ipq807x- and nbg7815 support to become official (may take months+).

slh
Thank you for the explanation

This morning I tried to get SCP access to this router and ran into a problem.
After reset I have accessed via telnet without problems with the default username and password (root nbg7815@2019).
I have made the pertinent modifications in /etc/config/dropbear and in /etc/config/network but when I ran vi /etc/init.d/preboot I found a slightly different file than the one mentioned here:

ck_ChangeDefaultCg()
{
        #SSH
        ck_ssh_remote=$(uci get firewall.remote_ssh.interface)
        if [ "$ck_ssh_remote" != "0" ]; then
                uci set firewall.remote_ssh.interface=0
                uci set firewall.remote_ssh.client_check=0
                uci set firewall.remote_ssh.port=22
                uci commit firewall
        fi

        #dropbear
        ck_dropbear=$(uci get dropbear.setting.enable)
        if [ "$ck_dropbear" != "0" ]; then
                uci set dropbear.setting.enable=0
                uci commit dropbear
        fi

        # If user already installed it will lock login permission
        install_mode=$(uci get system.main.install_mode)
        if [ "$install_mode" == "1" ]; then
                znet_setroot
        else
                #check LAN DNS default setting
                ckLanDNSDefaultCg=$(uci get dhcp.lan.lan_dns)
                if [ "$ckLanDNSDefaultCg" == "dnsRelay,FromISP,FromISP" ]; then
                        uci set dhcp.lan.lan_dns=dnsRelay,None,None
                        uci commit dhcp
                fi
        fi

        ckNowChangeDefaultCg=$(uci get system.main.changeDefaultCg)

        ##For changeDefaultCg=1
        ##For NBG7815. In US set 5G default channel at 157. In EU set 5G default channel at 100.
        if [ -z "$ckNowChangeDefaultCg" ];then

The file is larger but I've cut it here because the following refers exclusively to Wi-Fi

I have modified the file to leave it as follows:


        #SSH
        ck_ssh_remote=$(uci get firewall.remote_ssh.interface)
        if [ "$ck_ssh_remote" != "0" ]; then
                uci set firewall.remote_ssh.interface=0
                uci set firewall.remote_ssh.client_check=0
                uci set firewall.remote_ssh.port=22
                uci commit firewall
        fi

        #dropbear
        #ck_dropbear=$(uci get dropbear.setting.enable)
        #if [ "$ck_dropbear" != "0" ]; then
        #        uci set dropbear.setting.enable=0
        #        uci commit dropbear
        #fi

        # If user already installed it will lock login permission
        #install_mode=$(uci get system.main.install_mode)
        #if [ "$install_mode" == "1" ]; then
        #        znet_setroot
        #else
        #        #check LAN DNS default setting
        #        ckLanDNSDefaultCg=$(uci get dhcp.lan.lan_dns)
        #        if [ "$ckLanDNSDefaultCg" == "dnsRelay,FromISP,FromISP" ]; then
        #                uci set dhcp.lan.lan_dns=dnsRelay,None,None
        #                uci commit dhcp
        #        fi
        #fi

        ckNowChangeDefaultCg=$(uci get system.main.changeDefaultCg)

        ##For changeDefaultCg=1
        ##For NBG7815. In US set 5G default channel at 157. In EU set 5G default channel at 100.
        if [ -z "$ckNowChangeDefaultCg" ];then

After this I have restarted the device to test if I had SCP access and I've been able to verify that the dropbear parameter was:
dropbear.setting.enable=0

I have run again:
uci set dropbear.setting.enable=1
uci commit dropbear

This time I've restarted dropbear (/etc/init.d/dorpbear restart) and I have accessed the router via WinSCP without problems

But when I restarted the device again I verified that I had no access via SCP and when I edited the file /etc/config/dropbear again the enable option appeared as disabled.

I think the firmware I have installed on my router is not allowing dropbear to be permanently enabled as well as when the router is reconfigured the ability to log back in via SCP and telnet is not posible. The firmware that I currently have installed is V1.00(ABSK.7)C0.

The rest of the modifications have been maintained.
After reconfiguring the router, telnet access has also been lost.

Check if you have correct changes in preboot file,
I used similar firmware and never had a problem with reconfiguration preboot file, check also if you have proper uci dropbear and network settings

Before write the post i rechecked 2 time.

Now i rerechek and always get the same result.
after make change i've got this result.

NBG7815 login: root
Password:


BusyBox v1.25.1 (2022-07-28 04:23:53 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 (4e6ec22+r49254)

root@NBG7815:~# cat /etc/config/dropbear

config dropbear 'setting'
        option PasswordAuth 'on'
        option RootPasswordAuth 'on'
        option Port '22'
        option enable '1'

root@NBG7815:~# cat /etc/config/network |grep 'option auto'
        option auto_ip_change '0'
root@NBG7815:~# cat /etc/init.d/preboot
#!/bin/sh /etc/rc.common

START=03

ck_ChangeDefaultCg()
{
        #SSH
        ck_ssh_remote=$(uci get firewall.remote_ssh.interface)
        if [ "$ck_ssh_remote" != "0" ]; then
                uci set firewall.remote_ssh.interface=0
                uci set firewall.remote_ssh.client_check=0
                uci set firewall.remote_ssh.port=22
                uci commit firewall
        fi

        #dropbear
        #ck_dropbear=$(uci get dropbear.setting.enable)
        #if [ "$ck_dropbear" != "0" ]; then
        #       uci set dropbear.setting.enable=0
        #       uci commit dropbear
        #fi

        # If user already installed it will lock login permission
        #install_mode=$(uci get system.main.install_mode)
        #if [ "$install_mode" == "1" ]; then
        #       znet_setroot
        #else
        #       #check LAN DNS default setting
        #       ckLanDNSDefaultCg=$(uci get dhcp.lan.lan_dns)
        #       if [ "$ckLanDNSDefaultCg" == "dnsRelay,FromISP,FromISP" ]; then
        #               uci set dhcp.lan.lan_dns=dnsRelay,None,None
        #               uci commit dhcp
        #       fi
        #fi

        ckNowChangeDefaultCg=$(uci get system.main.changeDefaultCg)

        ##For changeDefaultCg=1
        ##For NBG7815. In US set 5G default channel at 157. In EU set 5G default channel at 100.
        if [ -z "$ckNowChangeDefaultCg" ];then
                countrycode=$(fw_printenv countrycode | awk -F"=" '{print $2}' | tr [a-f] [A-F])
                case "$countrycode" in
                        e1|E1) country="CH"
                                uci set wireless.wifi0.AutoChannelSelect=0
                                uci set wireless.wifi0.channel=100
                        ;;
                        *)
                                uci set wireless.wifi0.AutoChannelSelect=0
                                uci set wireless.wifi0.channel=157
                        ;;
                esac
                uci set wireless.wifi0.channel_width=80
                uci set wireless.ath0.he_ul_ofdma=0
                uci set wireless.ath0.he_dl_ofdma=0
                uci set wireless.ath0.he_ul_mimo=0
                uci set wireless.ath0.he_mubfer=0
                uci set wireless.ath0.disablecoext=0
                uci set wireless.ath0.vhtsubfer=1
                uci set wireless.ath1.he_ul_ofdma=0
                uci set wireless.ath1.he_dl_ofdma=0
                uci set wireless.ath1.he_ul_mimo=0
                uci set wireless.ath1.he_mubfer=0
                uci set wireless.ath1.disablecoext=0
                uci set wireless.ath1.vhtsubfer=1
                uci set wireless.ath2.he_ul_ofdma=0
                uci set wireless.ath2.he_dl_ofdma=0
                uci set wireless.ath2.he_ul_mimo=0
                uci set wireless.ath2.he_mubfer=0
                uci set wireless.ath2.disablecoext=0
                uci set wireless.ath2.vhtsubfer=1
                uci set wireless.ath3.he_ul_ofdma=0
                uci set wireless.ath3.he_dl_ofdma=0
                uci set wireless.ath3.he_ul_mimo=0
                uci set wireless.ath3.he_mubfer=0
                uci set wireless.ath3.disablecoext=0
                uci set wireless.ath10.he_ul_ofdma=0
                uci set wireless.ath10.he_dl_ofdma=0
                uci set wireless.ath10.he_ul_mimo=0
                uci set wireless.ath10.he_mubfer=0
                uci set wireless.ath10.vhtsubfer=1
                uci set wireless.ath11.he_ul_ofdma=0
                uci set wireless.ath11.he_dl_ofdma=0
                uci set wireless.ath11.he_ul_mimo=0
                uci set wireless.ath11.he_mubfer=0
                uci set wireless.ath11.vhtsubfer=1
                uci set wireless.ath12.he_ul_ofdma=0
                uci set wireless.ath12.he_dl_ofdma=0
                uci set wireless.ath12.he_ul_mimo=0
                uci set wireless.ath12.he_mubfer=0
                uci set wireless.ath12.vhtsubfer=1
                uci set wireless.ath13.he_ul_ofdma=0
                uci set wireless.ath13.he_dl_ofdma=0
                uci set wireless.ath13.he_ul_mimo=0
                uci set wireless.ath13.he_mubfer=0
                uci commit wireless

                uci set dhcp.lan.limit=200
                uci commit dhcp

                uci set system.main.changeDefaultCg=1
                uci commit system
                # This command is for emmc and ext4 filesystem
                /bin/sync
        fi
}

boot()
{
        local product_name=$(uci get system.main.product_name)

        ##Check ChangeDefaultCg
        ck_ChangeDefaultCg
}

After reboot the device i 've got this one:

NBG7815 login: root
Password:


BusyBox v1.25.1 (2022-07-28 04:23:53 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 (4e6ec22+r49254)

root@NBG7815:~# cat /etc/config/dropbear

config dropbear 'setting'
        option PasswordAuth 'on'
        option RootPasswordAuth 'on'
        option Port '22'
        option enable '0'

root@NBG7815:~# cat /etc/config/network |grep 'option auto'
        option auto_ip_change '0'
root@NBG7815:~# cat /etc/init.d/preboot
#!/bin/sh /etc/rc.common

START=03

ck_ChangeDefaultCg()
{
        #SSH
        ck_ssh_remote=$(uci get firewall.remote_ssh.interface)
        if [ "$ck_ssh_remote" != "0" ]; then
                uci set firewall.remote_ssh.interface=0
                uci set firewall.remote_ssh.client_check=0
                uci set firewall.remote_ssh.port=22
                uci commit firewall
        fi

        #dropbear
        #ck_dropbear=$(uci get dropbear.setting.enable)
        #if [ "$ck_dropbear" != "0" ]; then
        #       uci set dropbear.setting.enable=0
        #       uci commit dropbear
        #fi

        # If user already installed it will lock login permission
        #install_mode=$(uci get system.main.install_mode)
        #if [ "$install_mode" == "1" ]; then
        #       znet_setroot
        #else
        #       #check LAN DNS default setting
        #       ckLanDNSDefaultCg=$(uci get dhcp.lan.lan_dns)
        #       if [ "$ckLanDNSDefaultCg" == "dnsRelay,FromISP,FromISP" ]; then
        #               uci set dhcp.lan.lan_dns=dnsRelay,None,None
        #               uci commit dhcp
        #       fi
        #fi

        ckNowChangeDefaultCg=$(uci get system.main.changeDefaultCg)

        ##For changeDefaultCg=1
        ##For NBG7815. In US set 5G default channel at 157. In EU set 5G default channel at 100.
        if [ -z "$ckNowChangeDefaultCg" ];then
                countrycode=$(fw_printenv countrycode | awk -F"=" '{print $2}' | tr [a-f] [A-F])
                case "$countrycode" in
                        e1|E1) country="CH"
                                uci set wireless.wifi0.AutoChannelSelect=0
                                uci set wireless.wifi0.channel=100
                        ;;
                        *)
                                uci set wireless.wifi0.AutoChannelSelect=0
                                uci set wireless.wifi0.channel=157
                        ;;
                esac
                uci set wireless.wifi0.channel_width=80
                uci set wireless.ath0.he_ul_ofdma=0
                uci set wireless.ath0.he_dl_ofdma=0
                uci set wireless.ath0.he_ul_mimo=0
                uci set wireless.ath0.he_mubfer=0
                uci set wireless.ath0.disablecoext=0
                uci set wireless.ath0.vhtsubfer=1
                uci set wireless.ath1.he_ul_ofdma=0
                uci set wireless.ath1.he_dl_ofdma=0
                uci set wireless.ath1.he_ul_mimo=0
                uci set wireless.ath1.he_mubfer=0
                uci set wireless.ath1.disablecoext=0
                uci set wireless.ath1.vhtsubfer=1
                uci set wireless.ath2.he_ul_ofdma=0
                uci set wireless.ath2.he_dl_ofdma=0
                uci set wireless.ath2.he_ul_mimo=0
                uci set wireless.ath2.he_mubfer=0
                uci set wireless.ath2.disablecoext=0
                uci set wireless.ath2.vhtsubfer=1
                uci set wireless.ath3.he_ul_ofdma=0
                uci set wireless.ath3.he_dl_ofdma=0
                uci set wireless.ath3.he_ul_mimo=0
                uci set wireless.ath3.he_mubfer=0
                uci set wireless.ath3.disablecoext=0
                uci set wireless.ath10.he_ul_ofdma=0
                uci set wireless.ath10.he_dl_ofdma=0
                uci set wireless.ath10.he_ul_mimo=0
                uci set wireless.ath10.he_mubfer=0
                uci set wireless.ath10.vhtsubfer=1
                uci set wireless.ath11.he_ul_ofdma=0
                uci set wireless.ath11.he_dl_ofdma=0
                uci set wireless.ath11.he_ul_mimo=0
                uci set wireless.ath11.he_mubfer=0
                uci set wireless.ath11.vhtsubfer=1
                uci set wireless.ath12.he_ul_ofdma=0
                uci set wireless.ath12.he_dl_ofdma=0
                uci set wireless.ath12.he_ul_mimo=0
                uci set wireless.ath12.he_mubfer=0
                uci set wireless.ath12.vhtsubfer=1
                uci set wireless.ath13.he_ul_ofdma=0
                uci set wireless.ath13.he_dl_ofdma=0
                uci set wireless.ath13.he_ul_mimo=0
                uci set wireless.ath13.he_mubfer=0
                uci commit wireless

                uci set dhcp.lan.limit=200
                uci commit dhcp

                uci set system.main.changeDefaultCg=1
                uci commit system
                # This command is for emmc and ext4 filesystem
                /bin/sync
        fi
}

boot()
{
        local product_name=$(uci get system.main.product_name)

        ##Check ChangeDefaultCg
        ck_ChangeDefaultCg
}

The only diference is "option enable '0' " in dropbear setting

And after configure the router for zyxelcloud i loss telnet, dropbear and root access, like no modification was made.

I dont know went, but the firmware has been modify to V1.00(ABSK.8)C0.

PD: And the latest firmware is even worse than the previous ones.
Now I can't use the wan port as lan port anymore when I set it to bridge mode because the connection speed becomes 100Mb on that port!!!

Hi, can someone help me out, I'm getting this error:


This happened after I did:

dd if=/dev/zero of=/dev/mmcblk0p7
dd if=/tmp/ApplicationData/openwrt/kernel of=/dev/mmcblk0p7
    
dd if=/dev/zero of=/dev/mmcblk0p8 
dd if=/tmp/ApplicationData/openwrt/root of=/dev/mmcblk0p8

I tried @itorK methods for unbricking but I always get the same error message

@altuntepe how did you unbrick yourse ? Like step by step, because for some reason I'm dummer then normal, I think I'm doing something wrong, but I don't know what :confused:

thanks :slight_smile:

Loading: T T T

This is timeout, check your network, tftp server, turn off firewall

If connection is succesfull you should see something like this:

Loading: # # # #

Try to back to V7

With factory site:
https://192.168.123.1/gui/#/main/debug/firmwareupgrade