OpenWrt Forum Archive

Topic: ZyXEL NBG-419N v2 support

The content of this topic has been archived between 27 Nov 2017 and 28 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Last test for final(?) BB build released of Sep 29:
openwrt-ramips-rt305x-nbg-419n2-bb-final-squashfs-sysupgrade.bin - BB final patched image
bb-final-ramips-add-zyxel-nbg-419n2.patch - patch for BB final

This image is minimal support of nbg-419n2 (no additinal kernel modules, no wps action script).
BTW you can download Image Builder, apply patch and rebuild firmware as you wish.

Hello,

and sorry for my late reply. I've been sick.

However, I downloaded the image already a few days ago, but it didn't work???

During that time, the system complained that some of the packages can't be downloaded???

Ok, just now I saw the announcement of BB 14.07 release.

So, I installed the image again, and voilà, all of the packages can be dowloaded and installed with opkg!!!

However, you need to change the '1-1' to '1-2' in '/etc/config/system' !!!

root@OpenWrt:/# cat /etc/config/system

config system
        option hostname 'OpenWrt'
        option timezone 'UTC'

config timeserver 'ntp'
        list server '0.openwrt.pool.ntp.org'
        list server '1.openwrt.pool.ntp.org'
        list server '2.openwrt.pool.ntp.org'
        list server '3.openwrt.pool.ntp.org'
        option enable_server '0'

config led 'led_wifi_led'
        option name 'wifi'
        option sysfs 'rt2800pci-phy0::radio'
        option trigger 'netdev'
        option dev 'wlan0'
        option mode 'link tx rx'

config led 'led_usb'
        option name 'USB'
        option sysfs 'nbg-419n:green:usb'
        option trigger 'usbdev'
        option dev '1-2'                # This must be '1-2' instead of '1-1' !!!
        option interval '50'

Now, among the other features, the USB led is working as it's supposed to work.

And thanks for the tip; I'll try that Image Builder.

However, it would be nice to have an official image for the device, for other people as well.

Thank you so much.

Openwrt team rebuild release at Oct 2. I think that for fixing packages paths.
USB: "1-1" is correct value for high-speed usb 2.0 devices. Your stick is full-speed usb 1,1 device:

[  391.720000] usb 1-2: new full-speed USB device number 2 using ohci-platform
[  391.960000] usb 1-2: no of_node; not parsing pinctrl DT

Wrong detection or it is really old usb 1.1 device? So I prefer that "1-1" will be default value as more common case.

Hello,

and thank you so much for your quick response.

And yes, the USB stick what I've been using is indeed an old usb 1.1 device.

I like to use that usb stick for various testing, as it never contains anything important.

Also, I just tried the Image Builder.

I can produce an image, flash it to device, but now some of the led's won't work, i.e the power led, and the usb led. (Not sure about the WPS led atm)

wget http://downloads.openwrt.org/barrier_breaker/14.07/ramips/rt305x/OpenWrt-ImageBuilder-ramips_rt305x-for-linux-x86_64.tar.bz2

tar jxvf OpenWrt-ImageBuilder-ramips_rt305x-for-linux-x86_64.tar.bz2 

cd OpenWrt-ImageBuilder-ramips_rt305x-for-linux-x86_64

cp /home/jama/Downloads/OpenWRT/NBG-419N2.dts target/linux/ramips/dts/.

make image

make clean

Now, I modified the 'target/linux/ramips/image/Makefile' -file to take the new profile into account, by adding the following two lines in correct places:

Image/Build/Profile/NBG-419N2=$(call BuildFirmware/Default8M/$(1),$(1),nbg-419n2,NBG-419N2)
$(call Image/Build/Profile/NBG-419N2,$(1))

Then, creating the image, and including all the packages that were in your final build: (after checking those with 'opkg list-installed')

make image PROFILE=NBG-419N2 PACKAGES="base-files busybox dnsmasq dropbear firewall fstools hostapd-common ip6tables iptables iw jshn jsonfilter kernel kmod-cfg80211 kmod-crypto-aes kmod-crypto-arc4 kmod-crypto-core kmod-eeprom-93cx6 kmod-fs-vfat kmod-gpio-button-hotplug kmod-i2c-core kmod-input-core kmod-ip6tables kmod-ipt-conntrack kmod-ipt-core kmod-ipt-nat kmod-ipt-nathelper kmod-ipv6 kmod-leds-gpio kmod-ledtrig-usbdev kmod-lib-crc-ccitt kmod-lib-crc-itu-t kmod-mac80211 kmod-mmc kmod-nls-base kmod-nls-cp437 kmod-nls-iso8859-1 kmod-ppp kmod-pppoe kmod-pppox kmod-rt2800-lib kmod-rt2800-mmio kmod-rt2800-soc kmod-rt2x00-lib kmod-rt2x00-mmio kmod-scsi-core kmod-scsi-generic kmod-sdhci kmod-slhc kmod-usb-core kmod-usb-ohci kmod-usb-storage kmod-usb-storage-extras kmod-video-core kmod-video-uvc kmod-video-videobuf2 libblobmsg-json libc libgcc libip4tc libip6tc libiwinfo libiwinfo-lua libjson-c libjson-script liblua libncurses libnl-tiny libubox libubus libubus-lua libuci libuci-lua libxtables lua luci luci-app-firewall luci-base luci-lib-nixio luci-mod-admin-full luci-proto-ppp luci-theme-bootstrap mtd netifd odhcp6c odhcpd opkg ppp ppp-mod-pppoe procd swconfig terminfo ubox ubus ubusd uci uhttpd uhttpd-mod-ubus wpad-mini"

But the above mentioned leds won't work? (Yes, I checked/modified i.e. the /etc/config/system...)

Now, I must be missing something here, as I don't understand the build system and the architecure that well...

In my final patch some additional files are touched. I think you don't use patch command? Just change directory where you install ImageBuilder and call

patch <bb-filnal-ramips-add-zyxel-nbg-419n2.patch

Or look at patch file and make changes by hand in:
- target/linux/ramips/base-files/lib/ramips.h - board identification
- target/linux/ramips/base-files/lib/upgrade/platform.sh - to make sysupgrade happy
- target/linux/ramips/base-files/etc/diag.sh - to set status led
- target/linux/ramips/base-files/etc/uci-defaults/01_leds - to set other leds
You have made only last two changes from patch concerning makefile and dts-file smile.
BTW no need to include all packages from final image. You may create your own package set. And save it in target/linux/ramips/...../rt305x/profiles/nbg419n2.mk (forget exactly path) for future use.

Goog luck!

Hello,

I'm sorry, but it does not work. The leds, including the power led, are not working when the image is created with the ImageBuilder.

WAN and LAN leds do work.

I did everything from scratch:

wget http://downloads.openwrt.org/barrier_breaker/14.07/ramips/rt305x/OpenWrt-ImageBuilder-ramips_rt305x-for-linux-x86_64.tar.bz2
tar jxvf OpenWrt-ImageBuilder-ramips_rt305x-for-linux-x86_64.tar.bz2 
cd OpenWrt-ImageBuilder-ramips_rt305x-for-linux-x86_64

Then, the patch -file is supposed to patch a few, already existing files:

cat ../bb-final-ramips-add-zyxel-nbg-419n2.patch | grep ^Index
Index: target/linux/ramips/base-files/lib/ramips.sh
Index: target/linux/ramips/base-files/lib/upgrade/platform.sh
Index: target/linux/ramips/base-files/etc/diag.sh
Index: target/linux/ramips/base-files/etc/uci-defaults/01_leds
Index: target/linux/ramips/image/Makefile
Index: target/linux/ramips/dts/NBG-419N2.dts

So, just to ensure the functionality, we back-up the files.

mkdir backup_files
cat ../bb-final-ramips-add-zyxel-nbg-419n2.patch | grep ^Index | cut -d ' ' -f2 | xargs -i cp {} backup_files/.
cp: cannot stat ‘target/linux/ramips/dts/NBG-419N2.dts’: No such file or directory

Before patching the files, we need to create the .dts -file, since a file which does not exist can't be patched; i.e. the patch won't creat a new file. (At least not on Fedora 20).

touch target/linux/ramips/dts/NBG-419N2.dts

Then we patch:

patch < ../bb-final-ramips-add-zyxel-nbg-419n2.patch 
can't find file to patch at input line 5
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|Index: target/linux/ramips/base-files/lib/ramips.sh
|===================================================================
|--- target/linux/ramips/base-files/lib/ramips.sh    (revision 42702)
|+++ target/linux/ramips/base-files/lib/ramips.sh    (working copy)
--------------------------
File to patch: target/linux/ramips/base-files/lib/ramips.sh
patching file target/linux/ramips/base-files/lib/ramips.sh
can't find file to patch at input line 19
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|Index: target/linux/ramips/base-files/lib/upgrade/platform.sh
|===================================================================
|--- target/linux/ramips/base-files/lib/upgrade/platform.sh    (revision 42702)
|+++ target/linux/ramips/base-files/lib/upgrade/platform.sh    (working copy)
--------------------------
File to patch: target/linux/ramips/base-files/lib/upgrade/platform.sh
patching file target/linux/ramips/base-files/lib/upgrade/platform.sh
can't find file to patch at input line 31
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|Index: target/linux/ramips/base-files/etc/diag.sh
|===================================================================
|--- target/linux/ramips/base-files/etc/diag.sh    (revision 42702)
|+++ target/linux/ramips/base-files/etc/diag.sh    (working copy)
--------------------------
File to patch: target/linux/ramips/base-files/etc/diag.sh
patching file target/linux/ramips/base-files/etc/diag.sh
can't find file to patch at input line 45
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|Index: target/linux/ramips/base-files/etc/uci-defaults/01_leds
|===================================================================
|--- target/linux/ramips/base-files/etc/uci-defaults/01_leds    (revision 42702)
|+++ target/linux/ramips/base-files/etc/uci-defaults/01_leds    (working copy)
--------------------------
File to patch: target/linux/ramips/base-files/etc/uci-defaults/01_leds
patching file target/linux/ramips/base-files/etc/uci-defaults/01_leds
patching file Makefile
Hunk #1 FAILED at 448.
Hunk #2 FAILED at 605.
2 out of 2 hunks FAILED -- saving rejects to file Makefile.rej
patching file NBG-419N2.dts

It says that the Makefile can't be patched, and claims that the .dts -file is patched. (Which in fact didn't happen ??)

Now we compare the patched files, against the backed-up files:

mkdir new_files
cat ../bb-final-ramips-add-zyxel-nbg-419n2.patch | grep ^Index | cut -d ' ' -f2 | xargs -i cp {} new_files/.
for i in `ls backup_files` ; do echo " == $i ==" ; diff backup_files/$i new_files/$i ; done
 == 01_leds ==
134a135,138
>     nbg-419n2)
>         set_usb_led "nbg-419n2:green:usb"
>         set_wifi_led "rt2800pci-phy0::radio"
>         ;;
 == diag.sh ==
90a91,93
>     nbg-419n2)
>         status_led="nbg-419n2:green:power"
>         ;;
 == Makefile ==
 == NBG-419N2.dts ==
 == platform.sh ==
63a64
>     nbg-419n2 | \
 == ramips.sh ==
171a172,174
>     *"NBG-419N v2")
>         name="nbg-419n2"
>         ;;

We can see that some of the files were patched, and some were intact.

We must fix the remaining files by hand.

cp /home/jama/Downloads/OpenWRT/NBG-419N2.dts target/linux/ramips/dts/.
vi target/linux/ramips/image/Makefile

And perform the comparison of the Makefile again. (The .dts -file excluded due to size)

diff target/linux/ramips/image/Makefile backup_files/Makefile 
451d450
< Image/Build/Profile/NBG-419N2=$(call BuildFirmware/Default8M/$(1),$(1),nbg-419n2,NBG-419N2)
609d607
<     $(call Image/Build/Profile/NBG-419N2,$(1))

diff target/linux/ramips/image/Makefile new_files/Makefile 
451d450
< Image/Build/Profile/NBG-419N2=$(call BuildFirmware/Default8M/$(1),$(1),nbg-419n2,NBG-419N2)
609d607
<     $(call Image/Build/Profile/NBG-419N2,$(1))

As we can be confident that everything is as it's supposed to be, we can create the images.

make image

And verify the results.

ls -al bin/ramips/*419*
-rw-rw-r--. 1 jama jama 2883588 Oct  7 14:47 bin/ramips/openwrt-ramips-rt305x-nbg-419n2-squashfs-sysupgrade.bin
-rw-r--r--. 1 jama jama 2883588 Oct  7 14:47 bin/ramips/openwrt-ramips-rt305x-nbg-419n-squashfs-sysupgrade.bin

But the leds won't work. The image can be flashed, it boots, etc., but the leds won't work ??

During the boot, a message appears.

[    5.130000] leds-gpio gpio-leds.4: pins are not configured from the driver

????

Ok, I also tried to include everything to the single image again.

make image PACKAGES="base-files busybox dnsmasq dropbear firewall fstools hostapd-common ip6tables iptables iw jshn jsonfilter kernel kmod-cfg80211 kmod-crypto-aes kmod-crypto-arc4 kmod-crypto-core kmod-eeprom-93cx6 kmod-fs-vfat kmod-gpio-button-hotplug kmod-i2c-core kmod-input-core kmod-ip6tables kmod-ipt-conntrack kmod-ipt-core kmod-ipt-nat kmod-ipt-nathelper kmod-ipv6 kmod-leds-gpio kmod-ledtrig-usbdev kmod-lib-crc-ccitt kmod-lib-crc-itu-t kmod-mac80211 kmod-mmc kmod-nls-base kmod-nls-cp437 kmod-nls-iso8859-1 kmod-ppp kmod-pppoe kmod-pppox kmod-rt2800-lib kmod-rt2800-mmio kmod-rt2800-soc kmod-rt2x00-lib kmod-rt2x00-mmio kmod-scsi-core kmod-scsi-generic kmod-sdhci kmod-slhc kmod-usb-core kmod-usb-ohci kmod-usb-storage kmod-usb-storage-extras kmod-video-core kmod-video-uvc kmod-video-videobuf2 libblobmsg-json libc libgcc libip4tc libip6tc libiwinfo libiwinfo-lua libjson-c libjson-script liblua libncurses libnl-tiny libubox libubus libubus-lua libuci libuci-lua libxtables lua luci luci-app-firewall luci-base luci-lib-nixio luci-mod-admin-full luci-proto-ppp luci-theme-bootstrap mtd netifd odhcp6c odhcpd opkg ppp ppp-mod-pppoe procd swconfig terminfo ubox ubus ubusd uci uhttpd uhttpd-mod-ubus wpad-mini"

And check the image size again.

ls -al bin/ramips/*419*
-rw-rw-r--. 1 jama jama 3670020 Oct  7 15:22 bin/ramips/openwrt-ramips-rt305x-nbg-419n2-squashfs-sysupgrade.bin
-rw-r--r--. 1 jama jama 3670020 Oct  7 15:22 bin/ramips/openwrt-ramips-rt305x-nbg-419n-squashfs-sysupgrade.bin

Which shows that the image is much larger, and should now contain everything needed for leds to work.

But, still, the leds won't work ???

?????

1. Use -p option of patch command

patch -p0 < ../bb-final-ramips-add-zyxel-nbg-419n2.patch

2. Reset settings after firmware update with reset button or commands

firstboot; reboot

Leds configuration is saved in /etc/config/system only during first boot. Next upgrades preserve this system file.

Hello,

I'm sorry, but it does not work at all. No matter what I do.

If I i.e. flash 'openwrt-ramips-rt305x-nbg-419n2-bb-final-squashfs-sysupgrade.bin' first, (using TFTP) then upgrade it with my own image via LuCI, then, yes, it will retain the configuration files, including '/etc/config/system', but the leds won't work after all.

Issuing 'firstboot', and rebooting does not help. It looks that it resets '/etc/config/system' to some default one:

root@OpenWrt:/# cat /etc/config/system 
config system
        option hostname OpenWrt
        option timezone UTC

config timeserver ntp
        list server     0.openwrt.pool.ntp.org
        list server     1.openwrt.pool.ntp.org
        list server     2.openwrt.pool.ntp.org
        list server     3.openwrt.pool.ntp.org
        option enabled 1
        option enable_server 0

The same happens if I flash my own image directly, (using TFTP) without upgrading.

Could this be a kernel issue?

So,
- with  'openwrt-ramips-rt305x-nbg-419n2-bb-final-squashfs-sysupgrade.bin' everything works
- upgrade  'openwrt-ramips-rt305x-nbg-419n2-bb-final-squashfs-sysupgrade.bin' to my own image retains config files, but leds won't work
- issuing 'firstboot ; reboot' after upgrade makes no difference. Leds won't work
- flashing my own image directly (using TFTP) does not help, even I'd issue 'firstboot ; reboot'

?????

Did you apply patch? To check see rootfs image tree (root filesystem before packing):
build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/root-ramips/

For test BB release of Oct 2:
openwrt-ramips-rt305x-nbg-419n2-bb-final-squashfs-sysupgrade.v2.bin - only change kernel config (dts-file) and apply patch to userspace scripts

Hello,

Yes, I applied the patch. There're only a few steps to produce the image:

$ tar jxvf OpenWrt-ImageBuilder-ramips_rt305x-for-linux-x86_64.tar.bz2 

$ cd OpenWrt-ImageBuilder-ramips_rt305x-for-linux-x86_64/

$ patch -p0 < /home/jama/Downloads/OpenWRT/bb-final-ramips-add-zyxel-nbg-419n2.patch 
patching file target/linux/ramips/base-files/lib/ramips.sh
patching file target/linux/ramips/base-files/lib/upgrade/platform.sh
patching file target/linux/ramips/base-files/etc/diag.sh
patching file target/linux/ramips/base-files/etc/uci-defaults/01_leds
patching file target/linux/ramips/image/Makefile
patching file target/linux/ramips/dts/NBG-419N2.dts

$ make image

$ ls bin/ramips/*419*
bin/ramips/openwrt-ramips-rt305x-nbg-419n2-squashfs-sysupgrade.bin
bin/ramips/openwrt-ramips-rt305x-nbg-419n-squashfs-sysupgrade.bin

Then, copy the image (as root) to another location in order to make it available for TFTP download:

# cp bin/ramips/openwrt-ramips-rt305x-nbg-419n2-squashfs-sysupgrade.bin /var/lib/tftpboot/myimage.bin

Then, <... flash the image with tftp ...>

After the boot is fully completed, (a message ': procd: - init complete - seen on console) issue

root@OpenWrt:/# firstboot ; reboot

But, the power led won't work ??

However, if I now reboot, and flash the 'openwrt-ramips-rt305x-nbg-419n2-bb-final-squashfs-sysupgrade.v2.bin' -image, then the following appears on console, during the 'openwrt-ramips-rt305x-nbg-419n2-bb-final-squashfs-sysupgrade.v2.bin' boot:

[   24.130000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0001001c: 0x2651 instead
[   24.160000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00010020: 0xf4e4 instead
[   24.190000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00010024: 0xf73d instead
[   24.200000] jffs2: Further such events for this erase block will not be printed
[   24.330000] jffs2: Old JFFS2 bitmask found at 0x00017ee4
[   24.340000] jffs2: You cannot use older JFFS2 filesystems with newer kernels
[   24.440000] jffs2: Old JFFS2 bitmask found at 0x0001e00c
[   24.450000] jffs2: You cannot use older JFFS2 filesystems with newer kernels
[   24.480000] jffs2: Old JFFS2 bitmask found at 0x0001f074
[   24.490000] jffs2: You cannot use older JFFS2 filesystems with newer kernels
[   24.520000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020000: 0x1784 instead
[   24.580000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020004: 0x7099 instead
[   24.610000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020008: 0xd748 instead
[   24.640000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0002000c: 0xf175 instead
[   24.670000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020010: 0x77ab instead
[   24.700000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020014: 0x3b65 instead
[   24.730000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020018: 0x035b instead
[   24.760000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0002001c: 0xdab0 instead
[   24.790000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020020: 0xd761 instead
[   24.820000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020024: 0xe19c instead
[   24.830000] jffs2: Further such events for this erase block will not be printed
[   25.110000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00030000: 0xa1c3 instead
[   25.150000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00030004: 0x16b9 instead
[   25.180000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00030008: 0xb194 instead
[   25.210000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0003000c: 0xdfd9 instead
[   25.240000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00030010: 0x815c instead
[   25.270000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00030014: 0x309b instead
[   25.300000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00030018: 0x6007 instead
[   25.330000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0003001c: 0x3154 instead
[   25.360000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00030020: 0x2fa1 instead
[   25.390000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00030024: 0x5d65 instead
[   25.400000] jffs2: Further such events for this erase block will not be printed
[   25.670000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040000: 0xf9a9 instead
[   25.690000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040004: 0x22c3 instead
[   25.720000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040008: 0xb730 instead
[   25.750000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0004000c: 0x43bf instead
[   25.780000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040010: 0xb35a instead
[   25.810000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040014: 0x9bdf instead
[   25.840000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040018: 0x6280 instead
[   25.870000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0004001c: 0xc4e2 instead
[   25.900000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040020: 0xb473 instead
[   25.930000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00040024: 0xe4f9 instead
[   25.940000] jffs2: Further such events for this erase block will not be printed
[   26.040000] jffs2: Empty flash at 0x000437cc ends at 0x00044000
[   26.560000] jffs2: notice: (887) jffs2_build_xattr_subsystem: complete building xattr subsystem, 2 of xdatum (0 unchecked, 1 orphan) and 22 of xref (0 dead, 13 orphan) found.
[   27.280000] device eth0.1 entered promiscuous mode
[   27.290000] device eth0 entered promiscuous mode
[   27.320000] br-lan: port 1(eth0.1) entered forwarding state
[   27.330000] br-lan: port 1(eth0.1) entered forwarding state
[   29.330000] br-lan: port 1(eth0.1) entered forwarding state
procd: - init complete -

But the kernel version is supposed to be the same ??

However, now the power led works.

If I now issue:

root@OpenWrt:/# firstboot ; reboot

Everything works still.

If I now flash my own image, and boot, the power led won't work anymore.

The power led goes off once 'procd: - preinit -' appears on console.


Issuing 'firstboot ; reboot' after the boot is completed (procd: - init complete - seen on console) does nothing.

The power led stays on during the boot, but goes off immediately after procd: - preinit -' appears on console.


?????

I've no idea what is wrong.
Check two point:
1. Power led work if you echo 1 > /sys/class/leds/nbg-419n2:green:power/brightness
2. See output of cat /proc/cpuinfo

Hello,

2. See output of cat /proc/cpuinfo

root@OpenWrt:/# cat /proc/cpuinfo
system type             : Ralink RT3352 id:1 rev:6
machine                 : ZyXEL NBG-419N v2
processor               : 0
cpu model               : MIPS 24KEc V4.12
BogoMIPS                : 255.59
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 32
extra interrupt vector  : yes
hardware watchpoint     : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa                     : mips1 mips2 mips32r1 mips32r2
ASEs implemented        : mips16 dsp
shadow register sets    : 1
kscratch registers      : 0
core                    : 0
VCED exceptions         : not available
VCEI exceptions         : not available

However, I can confirm that I was able to produce a completely working build, by cross-compiling the image myself, instead of using the ImageBuilder:

$ svn co svn://svn.openwrt.org/openwrt/branches/barrier_breaker@42056 BB-r42056

$ cd BB-r42056/

$ patch -p0 < /home/jama/Downloads/OpenWRT/bb-final-ramips-add-zyxel-nbg-419n2.patch
patching file target/linux/ramips/base-files/lib/ramips.sh
patching file target/linux/ramips/base-files/lib/upgrade/platform.sh
patching file target/linux/ramips/base-files/etc/diag.sh
patching file target/linux/ramips/base-files/etc/uci-defaults/01_leds
patching file target/linux/ramips/image/Makefile
Hunk #2 succeeded at 601 (offset -5 lines).
patching file target/linux/ramips/dts/NBG-419N2.dts

$ ./scripts/feeds update -a

$ ./scripts/feeds install -a

$ make menuconfig

To configure the image, I selected the following to be included, in addition to existing ones, in the image (by pressing 'y'):

Target System (Ralink RT288x/RT3xxx)  ---> 
Subtarget (RT3x5x/RT5350 based boards)  ---> 

[Global build settings]
- Enable rfkill support
[Kernel modules]
+[Block Devices]
 - kmod-scsi-core
 - kmod-scsi-generic
+[Filesystems]
 - kmod-fs-vfat 
+[LED Modules]
 - kmod-ledtrig-default-on
 - kmod-ledtrig-gpio
+[Native Language Support]
 - kmod-nls-cp437
 - kmod-nls-iso8859-1
 - kmod-nls-iso8859-15
 - kmod-nls-utf8
+[Other modules]
 - kmod-mmc
 - kmod-rfkill
 - kmod-sdhci
+[USB Support]
 - kmod-usb-ohci
 - kmod-usb-storage
 - kmod-usb-storage-extras
 - kmod-usb-uhci
 - kmod-usb2

After the configuration, I simply ran:

$ make -j 9

And flashed the image.

Now, everything works. And, I mean everything:
- power led
- lan led(s)
- wan led
- wifi led
- rfkill
- wps led
- usb led (after modification, though)

However, the usb led does not work unless '1-1' is changed to '1-2' in /etc/config/system !!!

I don't know should the 'kmod-usb2' be included or not, and does it affect to usb led in any way, but now the led won't lit at all if a 1.1 stick is inserted. (Not a problem; nobody uses these anymore smile)

Do you know how to make a permanent change to /etc/config/system so '1-2' would always be included by default ???

So, there must be something wrong with the ImageBuilder ??

In file target/linux/ramips/base-files/etc/uci-defaults/01_leds change "1-1" to "1-2" and your leds will be ok for usb 1.1 devices by default.

Hello,

I can confirm that once the change is made, the USB led works, and this is the only way to have the USB led work.

Now, I don't know what does this '1-1' or '1-2' setting do, but based on my test results, it seems that the setting is related to the number of the USB port(s), and has nothing to with USB 1.1 or 2.0.

If you take a look of the v2 board, https://wikidevi.com/wiki/File:ZyXEL_NB … rd_top.jpg, you can see two lanes coming from the CPU, of which the other one ends to an USB -connector, while the other one has nothing connected.

So, I assume that the board was supposed to have two USB ports, but is only having one.

Also, by opening the cover (or taking a very careful look of the picture) and reading the printouts on the board, you can see markings (silk screen prints) 'USB1' and 'USB2'.

Of which the USB2 has the connector, while the USB1 is empty.

Test results

change 1-1 to 1-2

include usb2 kernel module

with usb 2.0 stick the led is on
with usb 1.1 stick the led is off

exclude usb2 kernel module

with usb 2.0 stick the led is on
with usb 1.1 stick the led is on

So, based on the test above, it's up to the USB kernel module whether or not the USB led is on with different USB stick.

keep 1-1 setting

include usb2 kernel module

with usb 2.0 stick the led is off
with usb 1.1 stick the led is off

exclude usb2 kernel module

with usb 2.0 stick the led is off
with usb 1.1 stick the led is off

Also, it's worth to mention that:

- USB 1.1 and USB 2.0 sticks both work regardless of '1-1' or '1-2' setting, but the USB led is lit only when set to '1-2'
- USB 1.1 stick works even if the usb2 -kernel module is included, but the USB led won't lit at all
- USB 1.1 and USB 2.0 sticks both work even if the usb2 kernel module is excluded


:: FINAL TEST RESULTS OF NBG-419 v2 ::

The ImageBuilder does not work. Do not use ImageBuilder at all to create an image for NBG-419N v2.

Instead of using the ImageBuilder, check-out the code, patch it with Serge's patch-file, modify the leds -file, configure, and cross-compile the image by yourself.

!! NOTE !! At least I was not able to produce a working image with ImageBuilder, even I patched the files.


... CONCLUSION ...

OpenWRT BB release works on NBG-419 v2 after patched with Serge's patch-file, and the value in file 'target/linux/ramips/base-files/etc/uci-defaults/01_leds' is changed from "1-1" to "1-2", and the image is cross-compiled, as at the moment it seems that ImageBuilder can not be used to generate an image for NBG-419 v2.

Otherwise there are no more issues.
So, based on testings, solutions and the workflow, I recommend approving NBG-419 v2 compatible with BB.
I'm looking forward to see official builds for NBG-419 v2, as not so many are able to generate images by themselves, and the official builds would have compatibility with OpenWRT official opkg -repositories.


Thank you all, especially to Serge for your time and passion to this issue.

Just for test check a case when:
1. "1-1"
2. module usb2
3. stick usb 2.0

Hello,

Just for test check a case when:
1. "1-1"
2. module usb2
3. stick usb 2.0

The USB led is off with the following settings, regardelss of USB 1.1 or USB 2.0 stick:

root@OpenWrt:/# cat /etc/config/system 

config system
        option hostname 'OpenWrt'
        option timezone 'UTC'

config timeserver 'ntp'
        list server '0.openwrt.pool.ntp.org'
        list server '1.openwrt.pool.ntp.org'
        list server '2.openwrt.pool.ntp.org'
        list server '3.openwrt.pool.ntp.org'
        option enabled '1'
        option enable_server '0'

config led 'led_usb'
        option name 'USB'
        option sysfs 'nbg-419n2:green:usb'
        option trigger 'usbdev'
        option dev '1-1'
        option interval '50'

config led 'led_wifi_led'
        option name 'wifi'
        option sysfs 'rt2800pci-phy0::radio'
        option trigger 'netdev'
        option dev 'wlan0'
        option mode 'link tx rx'

root@OpenWrt:/# opkg list-installed | grep -i usb
kmod-ledtrig-usbdev - 3.10.49-1
kmod-usb-core - 3.10.49-1
kmod-usb-ohci - 3.10.49-1
kmod-usb-rt305x-dwc_otg - 3.10.49-1
kmod-usb-storage - 3.10.49-1
kmod-usb-storage-extras - 3.10.49-1
kmod-usb-uhci - 3.10.49-1
kmod-usb2 - 3.10.49-1

The build is  BARRIER BREAKER (14.07, r42625)

The setting must be '1-2' on the v2 model.

!! NOTE !!

I think there's a bug with the spi. In order to have the r42625 working on v2, you must delete file 'target/linux/ramips/patches-3.10/0222-rt5350-spi-second-device.patch' !!

In addition to the file above, you may also delete file 'target/linux/ramips/patches-3.14/0104-rt5350-spi-second-device.patch' as well. However, I didn't see any difference.

I recommend deleting the file(s) immediately after checkout, before patching and cross-compiling.

I think this is the reason why the ImageBuilder does not work.

I came to this conclusion after some 'svn diff', as i.e. r42056 and r42286 worked straight out of the box. Just 'svn co' either of those, patch, and cross-compile.

i.e. r42475 does not work anymore without deleteing the file(s), as well as r42625.

Thank you, again.

I'd like to see output of commands dmesg and lsmod for case "1-1", module usb2 and usb2.0 stick.

Hello,

I'd like to see output of commands dmesg and lsmod for case "1-1", module usb2 and usb2.0 stick.

The following is printed on console after an USB 2.0 stick is inserted:

[   58.200000] usb 1-2: new high-speed USB device number 2 using ehci-platform
[   58.380000] usb-storage 1-2:1.0: USB Mass Storage device detected
[   58.400000] scsi0 : usb-storage 1-2:1.0
[   59.410000] scsi 0:0:0:0: Direct-Access     JetFlash Transcend 4GB    8.07 PQ: 0 ANSI: 4
[   59.430000] sd 0:0:0:0: Attached scsi generic sg0 type 0
[   59.440000] sd 0:0:0:0: [sda] 7864320 512-byte logical blocks: (4.02 GB/3.75 GiB)
[   59.460000] sd 0:0:0:0: [sda] Write Protect is off
[   59.470000] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[   59.500000]  sda: sda1
[   59.520000] sd 0:0:0:0: [sda] Attached SCSI removable disk

And the same can be found with 'dmesg':

[   58.200000] usb 1-2: new high-speed USB device number 2 using ehci-platform
[   58.380000] usb 1-2: no of_node; not parsing pinctrl DT
[   58.380000] usb-storage 1-2:1.0: no of_node; not parsing pinctrl DT
[   58.380000] usb-storage 1-2:1.0: USB Mass Storage device detected
[   58.400000] scsi0 : usb-storage 1-2:1.0
[   59.410000] scsi 0:0:0:0: Direct-Access     JetFlash Transcend 4GB    8.07 PQ: 0 ANSI: 4
[   59.430000] sd 0:0:0:0: no of_node; not parsing pinctrl DT
[   59.430000] sd 0:0:0:0: Attached scsi generic sg0 type 0
[   59.440000] sd 0:0:0:0: [sda] 7864320 512-byte logical blocks: (4.02 GB/3.75 GiB)
[   59.460000] sd 0:0:0:0: [sda] Write Protect is off
[   59.470000] sd 0:0:0:0: [sda] Mode Sense: 23 00 00 00
[   59.470000] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[   59.500000]  sda: sda1
[   59.520000] sd 0:0:0:0: [sda] Attached SCSI removable disk

As well as after the USB 2.0 stick is removed:

[  406.820000] usb 1-2: USB disconnect, device number 2

While the modules loaded are: (during the time when the USB 2.0 stick is inserted)

root@OpenWrt:~# lsmod
arc4                    1312  2 
cfg80211              197911  2 rt2x00lib
compat                  2285  3 rt2800soc
crc_ccitt               1019  2 rt2800lib
crc_itu_t               1019  0 
crypto_blkcipher       10375  1 arc4
dwc_otg                61645  0 
eeprom_93cx6            1807  0 
ehci_hcd               29964  1 ehci_platform
ehci_platform           2272  0 
fat                    45167  1 vfat
gpio_button_hotplug     6000  0 
input_core             24281  1 rfkill
ip6_tables              8993  3 ip6table_raw
ip6t_REJECT             2336  2 
ip6table_filter          656  1 
ip6table_mangle         1024  1 
ip6table_raw             576  1 
ip_tables               9165  4 iptable_nat
ipt_MASQUERADE          1136  1 
ipt_REJECT              1776  2 
iptable_filter           720  1 
iptable_mangle           928  1 
iptable_nat             1680  1 
iptable_raw              640  1 
ipv6                  238854 32 ip6t_REJECT
leds_gpio               2944  0 
ledtrig_gpio            2048  0 
ledtrig_usbdev          1952  0 
mac80211              345713  3 rt2800lib
mmc_block              20593  0 
mmc_core               69530  2 mmc_block
nf_conntrack           44779 13 iptable_nat
nf_conntrack_ftp        5136  1 nf_nat_ftp
nf_conntrack_ipv4       4676  8 
nf_conntrack_ipv6       4976  3 
nf_conntrack_irc        2784  1 nf_nat_irc
nf_defrag_ipv4           758  1 nf_conntrack_ipv4
nf_defrag_ipv6          8695  1 nf_conntrack_ipv6
nf_nat                  9759  7 iptable_nat
nf_nat_ftp              1216  0 
nf_nat_ipv4             2526  1 iptable_nat
nf_nat_irc              1008  0 
nls_base                5006  7 vfat
nls_cp437               4432  0 
nls_iso8859_1           2896  0 
nls_iso8859_15          3408  0 
nls_utf8                 864  0 
ohci_hcd               13360  0 
ppp_async               6176  0 
ppp_generic            19650  3 pppoe
pppoe                   7744  0 
pppox                   1338  1 pppoe
rfkill                 11874  0 
rt2800lib              91409  2 rt2800soc
rt2800mmio              6338  1 rt2800soc
rt2800soc               2480  0 
rt2x00lib              34095  5 rt2800soc
rt2x00mmio              1952  2 rt2800soc
rt2x00soc               1218  1 rt2800soc
scsi_mod               76898  4 ums_cypress
sd_mod                 25168  0 
sdhci                  17250  1 sdhci_pltfm
sdhci_pltfm             2866  0 
sg                     19120  0 
slhc                    4347  1 ppp_generic
tun                    14511  0 
ums_alauda              8288  0 
ums_cypress             2256  0 
ums_datafab             4688  0 
ums_freecom             1952  0 
ums_isd200              4976  0 
ums_jumpshot            3632  0 
ums_karma               1536  0 
ums_sddr09              8752  0 
ums_sddr55              4832  0 
ums_usbat               7344  0 
usb_common              1160  1 usbcore
usb_storage            35976 10 ums_usbat
usbcore               106727 16 ums_usbat
vfat                    7808  0 
x_tables               10997 26 ipt_MASQUERADE
xt_CT                   2272  0 
xt_LOG                  9552  0 
xt_REDIRECT             1056  0 
xt_TCPMSS               2704  2 
xt_comment               480 53 
xt_conntrack            2144 10 
xt_id                    480  0 
xt_limit                 992 20 
xt_mac                   608  0 
xt_mark                  672  0 
xt_multiport            1200  0 
xt_nat                  1072  0 
xt_state                 688  0 
xt_tcpudp               1712  8 
xt_time                 1664  0 

And, during the boot, the following is displayed on console:

[    6.350000] ohci-platform 101c1000.ohci: irq 26, io mem 0x101c1000
[    6.420000] hub 2-0:1.0: USB hub found
[    6.430000] hub 2-0:1.0: 2 ports detected
[    6.450000] dwc_otg: version 2.72a 24-JUN-2008
[    6.460000] leds-gpio gpio-leds.4: pins are not configured from the driver

The settings are still the same:

root@OpenWrt:~# cat /etc/config/system 

config system
    option hostname 'OpenWrt'
    option timezone 'UTC'

config timeserver 'ntp'
    list server '0.openwrt.pool.ntp.org'
    list server '1.openwrt.pool.ntp.org'
    list server '2.openwrt.pool.ntp.org'
    list server '3.openwrt.pool.ntp.org'
    option enabled '1'
    option enable_server '0'

config led 'led_usb'
    option name 'USB'
    option sysfs 'nbg-419n2:green:usb'
    option trigger 'usbdev'
    option dev '1-1'
    option interval '50'

config led 'led_wifi_led'
    option name 'wifi'
    option sysfs 'rt2800pci-phy0::radio'
    option trigger 'netdev'
    option dev 'wlan0'
    option mode 'link tx rx'

root@OpenWrt:~# opkg list-installed | grep -i usb
kmod-ledtrig-usbdev - 3.10.49-1
kmod-usb-core - 3.10.49-1
kmod-usb-ohci - 3.10.49-1
kmod-usb-rt305x-dwc_otg - 3.10.49-1
kmod-usb-storage - 3.10.49-1
kmod-usb-storage-extras - 3.10.49-1
kmod-usb-uhci - 3.10.49-1
kmod-usb2 - 3.10.49-1
root@OpenWrt:~# 

I hope this helps.

Hello guys,

have you finished testing? Are the patches sent to the developers?

Hi,
I'm would like to try to build for nbg-419n_v2.
Can I find the patch file you created somewhere or could you share it sarge?
Regards

jonojen wrote:

Hi,
I'm would like to try to build for nbg-419n_v2.
Can I find the patch file you created somewhere or could you share it sarge?
Regards

Patch for BB 14.07 you can find https://yadi.sk/d/1ZV0lKJwbTE65. For CC 15.05 need some changes.

Great thanks !!!
Would have taken a beginner like me ages to get there if ever.

Hi

Seems to work great with 15.05 as well with some small change to your patch file for 14.07 (see below).

I have compiled and run the code on the router and tested lan port and wifi so far. USB port and led not tested yet. My spare time is consumed by the kids...

jon@owrt:~/openwrt_15_05$ diff ../openwrt_14_07/sarge/bb-final-ramips-add-zyxel-nbg-419n2.patch add-nbg-419n2_on_15_manual.patch 
43,44c43,44
< --- target/linux/ramips/base-files/etc/uci-defaults/01_leds    (revision 42702)
< +++ target/linux/ramips/base-files/etc/uci-defaults/01_leds    (working copy)
---
> --- target/linux/ramips/base-files/etc/board.d/01_leds
> +++ target/linux/ramips/base-files/etc/board.d/01_leds    (working copy)
jon@owrt:~/openwrt_15_05$ 

Thanks again!