[SOLVED] ZyXEL NBG6617 - TFTP flash wont take

Hi
I followed this : (from https://github.com/chunkeey/LEDE-IPQ40XX/commit/07603a724d5f3d6d7cbba374aa86e637f60ba16c )

first install / debricking / restore stock:
0. Have a PC running a tftp-server @ 192.168.1.99

  1. connect the PC to any LAN-Ports
  2. put the openwrt...-factory.bin (or V1.00(ABCT.X).bin for stock) file
    into the tftp-server root directory and rename it to just "ras.bin".
  3. power-cycle the router and hold down the the WPS button (for 30sek)
  4. Wait (for a long time - the serial console provides some progress
    reports. The u-boot says it best: "Please be patient".
  5. Once the power LED starts to flashes slowly and the USB + WPS LEDs
    flashes fast at the same time. You have to reboot the device and
    it should then come right up.

But still after 30 min only power led is flashing and usb led is lit up all the time.
I´m not connected to serial console, so I cant see progress - should I wait more then 30 min?
If I power off and on, then it just boot original firmware.

TFTP server says upload is suscesful every time I try.

Thank you for your help.

Try to put an unmanaged switch between your router and the tftp server, extrapolating from my experiences with the nbg6817, the tftp window is very small (3s) and link training might take too long - a switch keeps the link to your computer up, even if the router is powered off or rebooting, and might give you some crucial time.

Thank you for your respond.
The tftp server clearly say success uploading
But I'll try your solution.
I'll report back.

Okay.
Same result.
TFTP server finish uploading (I see 100% and after a sec or two connection closes).
But still after 30 min only power led is flashing and usb led is lit up all the time.

I tried using Zyxwl's GUI and uploading the same file as the one I tried for tftp, but I get this error:

Firmware upgrade error...
The flash image upload failed. The error messages are as follows:
Wrong Project Name Wrong firmware image header!

Okay a short update.
I tried this again :

  1. connect the PC to any LAN-Ports
  2. put the openwrt...-factory.bin (or V1.00(ABCT.X).bin for stock) file
    into the tftp-server root directory and rename it to just "ras.bin".
  3. power-cycle the router and hold down the the WPS button (for 30sek)

But this time I let go of WPS button when tftp server starts sending the file (it starts sending after ~10 seconds).

I tried with and with out a switch - still no luck.
Still after 30 min only power led is flashing and usb led is lit up all the time.

I guess you would need to attach a serial console, in order to see what the device is doing. It could be something related to the tftp-server you are using, some have problems with the "binary" mode... I'm using the standard tftpd-hpa server that comes with debian (sid) 5.2+20150808-1+b1.

But... you might as well not bother with tftp. Because David Bauer decided to change the image creation code for the the official openwrt snapshot factory.bin images to make it possible to flash them via the web-interface on the stock firmware. Just follow the steps under the "Installation via Web-UI" topic.

(Never tested it myself though, but I think you can write him a mail, if you run into any issue with the web-ui flash.)

Thank you for your respond.

Web flash do no work - see previous reply from me.

I tried some other tftp servers - no luck.

Sadly I turned off the router when it was download, and not it wont boot or respond to tftp server :frowning:
Stupid me!
It will respond to ping.

What is David Bauer handel? I'll like to tag him for the web gui update error.

Wrong Project Name Wrong firmware image header!

Can you upload/link the exact file you have been using there?
(As well as a sha256sum)? I can test it with the NBG6617 and
see what's on the serial console there.

Well, you could try to respond to the github PR. But I don't know if he's reading this forum. When in doubt you could write a mail to the e-mail address he used on the PR.

Thank you
This is the file I downloaded (and renamed to ras.bin) ras.bin
sha256: 33F3134CF18D0A8417E6F2104091C97E226A2DF128E92826BE4AE5F15C9CBCE3

Both router where on org. firmware V1.00(ABCT.6)C0 I tried downgrade to the oldest one V1.00(ABCT.5)C0
(October 27, 2017) stil no luck in Zyxel web gui or tftp - I have tried 3 different tftp software, and all of the made it to 100% every time.

I'll send him an email.

thank you for your time.

Ok. I looked at the image and it is clearly broken. I looked up the builder log:

http://phase1.builds.lede-project.org/builders/ipq40xx%2Fgeneric/builds/163/steps/images/logs/stdio

> >/var/lib/buildbot/slaves/slashdirt-02/MAIN/build/scripts/make-ras.sh: line 114: "41150" >> 24 | ("41150" & 0xff0000) >> 8 | ("41150" & 0xff00) << 8 | ("41150" & 0xff) << 24 : syntax error: operand expected (error token is ""41150" >> 24 | ("41150" & 0xff0000) >> 8 | ("41150" & 0xff00) << 8 | ("41150" & 0xff) << 24 ")
> /var/lib/buildbot/slaves/slashdirt-02/MAIN/build/scripts/make-ras.sh: line 114: "20316160" >> 24 | ("20316160" & 0xff0000) >> 8 | ("20316160" & 0xff00) << 8 | ("20316160" & 0xff) << 24 : syntax error: operand expected (error token is ""20316160" >> 24 | ("20316160" & 0xff0000) >> 8 | ("20316160" & 0xff00) << 8 | ("20316160" & 0xff) << 24 ")
> /var/lib/buildbot/slaves/slashdirt-02/MAIN/build/scripts/make-ras.sh: line 135: "" & 0xff: syntax error: operand expected (error token is """ & 0xff")
> /var/lib/buildbot/slaves/slashdirt-02/MAIN/build/scripts/make-ras.sh: line 136: >> 8: syntax error: operand expected (error token is ">> 8")
> /var/lib/buildbot/slaves/slashdirt-02/MAIN/build/scripts/make-ras.sh: line 135: "" & 0xff: syntax error: operand expected (error token is """ & 0xff")
> /var/lib/buildbot/slaves/slashdirt-02/MAIN/build/scripts/make-ras.sh: line 136: >> 8: syntax error: operand expected (error token is ">> 8")
> /var/lib/buildbot/slaves/slashdirt-02/MAIN/build/scripts/make-ras.sh: line 114: "53034" >> 24 | ("53034" & 0xff0000) >> 8 | ("53034" & 0xff00) << 8 | ("53034" & 0xff) << 24 : syntax error: operand expected (error token is ""53034" >> 24 | ("53034" & 0xff0000) >> 8 | ("53034" & 0xff00) << 8 | ("53034" & 0xff) << 24 ")
> cp /var/lib/buildbot/slaves/slashdirt-02/MAIN/build/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-ipq40xx/tmp/openwrt-ipq40xx-zyxel_nbg6617-squashfs-sysupgrade.bin /var/lib/buildbot/slaves/slashdirt-02/MAIN/build/bin/targets/ipq40xx/generic/openwrt-ipq40xx-zyxel_nbg6617-squashfs-sysupgrade.bin
> /var/lib/buildbot/slaves/slashdirt-02/MAIN/build/scripts/make-ras.sh: line 114: "2248620" >> 24 | ("2248620" & 0xff0000) >> 8 | ("2248620" & 0xff00) << 8 | ("2248620" & 0xff) << 24 : syntax error: operand expected (error token is ""2248620" >> 24 | ("2248620" & 0xff0000) >> 8 | ("2248620" & 0xff00) << 8 | ("2248620" & 0xff) << 24 ")
> /var/lib/buildbot/slaves/slashdirt-02/MAIN/build/scripts/make-ras.sh: line 135: "" & 0xff: syntax error: operand expected (error token is """ & 0xff")
> /var/lib/buildbot/slaves/slashdirt-02/MAIN/build/scripts/make-ras.sh: line 136: >> 8: syntax error: operand expected (error token is ">> 8")
> /var/lib/buildbot/slaves/slashdirt-02/MAIN/build/scripts/make-ras.sh: line 135: "" & 0xff: syntax error: operand expected (error token is """ & 0xff")
> /var/lib/buildbot/slaves/slashdirt-02/MAIN/build/scripts/make-ras.sh: line 136: >> 8: syntax error: operand expected (error token is ">> 8")
> /var/lib/buildbot/slaves/slashdirt-02/MAIN/build/scripts/make-ras.sh: line 135: "" & 0xff: syntax error: operand expected (error token is """ & 0xff")
> /var/lib/buildbot/slaves/slashdirt-02/MAIN/build/scripts/make-ras.sh: line 136: >> 8: syntax error: operand expected (error token is ">> 8")
> /var/lib/buildbot/slaves/slashdirt-02/MAIN/build/scripts/make-ras.sh: line 114: "56991" >> 24 | ("56991" & 0xff0000) >> 8 | ("56991" & 0xff00) << 8 | ("56991" & 0xff) << 24 : syntax error: operand expected (error token is ""56991" >> 24 | ("56991" & 0xff0000) >> 8 | ("56991" & 0xff00) << 8 | ("56991" & 0xff) << 24 ")
> /var/lib/buildbot/slaves/slashdirt-02/MAIN/build/scripts/make-ras.sh: line 135: "" & 0xff: syntax error: operand expected (error token is """ & 0xff")
> /var/lib/buildbot/slaves/slashdirt-02/MAIN/build/scripts/make-ras.sh: line 136: >> 8: syntax error: operand expected (error token is ">> 8")

so it's clear that the builder hit a problem in the make-ras.sh's to_be32. The question is what's the cause? A incompatible bash interpreter, or an obsolete bash? @jow (can you tell me what the distro + packages the slashdirt builder
are running?)

As for a fix: I did update the make-ras.sh script in my LEDE-IPQ40XX (the OpenWrt version is older) a while long ago (maybe 2-3 month now?) to address issues that came up when I was testing the script with OpenWrt's busybox and goodol' Mac OS X 10.5' bash.

I opted to integrate the to_be32 and append_bin into a new append_be32() that worked on all DUTs.

updated make-ras.sh - wait for it to load fully

Thank you.

So just to make it clear to me, there is a fix for next time it gets build?

Update:
David Bauer provided me with the first firmware he made for NBG6617, and that flashed via tftp no problem!

So now I just need to unbrick the one router I turn off while it was receiving the firmware from tftp server.

Short update:

This morning powering NBG6617 backup it had returned to ZyXEL's firmware.

I flashed the factory upgrade firmware provided by David Bauer using tftp server - and the router works with openwrt, I did my setting, and I pulled power for 12 mins, and this time it loaded openwrt like it should.

Is this one of them routers that need double firmware upgrading for it to stick?

No? One install should be enough.

As for the issue

webupgrade to last snapshot from openwrt will upload and reboot router, but
it will not come back online!

I think this has been fixed by this:
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=3dd692cd6b5643a1d3415eedc4f8a6736e9979da

Thank you.

First one is so fare running fine.

To recap for others : just flash though ZyXEL web gui as normal.

I'll mark as solved.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.