Topic: Serial data won't make any sense

While sysupgrading something went wrong and my Buffalo WZR-HP-G300NH stuck during boot.

Then I tried to connect via serial port.
First tried the RS232 interface and then a serial-USB adaptor.
In both case, what I read from serial port when I plug the adaptor in is something like this:

xaa:\0xfa+\0xaa*
\0xda\0xd4\0xb4\0xec\0xeb\0xd66\0x96\0xe9\0x9b\0xdaT\0xaa\0xba*\0xeb\0x00R\0xfb\0xfb\0xfb\0xdb6\0xdb\0xf6\0xf6\0xf6\0xf6\0xf6V\0xeaK\0xd5\0xda\0x1a\0xaa:\0xfa\0xfb\0xd4\0x1aj\0xca\0xfa+\0xfb\0x1b
\0xba\0xf4\0xcb\0xd44)j\0x1a\0x8aZ\0xf6\0x1b\0x85\0xfak\0x1aj\0xba\0xf4\0x9b
\0xaa4\0xba\0x1a\0xfb\0xfb\0xbb\0xb5\0xd4\0xe8\0xfb\0xd4\0xca\0x94\0xd4i)\0xd3k\0x1aj\0xbaT\0xf6\0x0b\0xfat\0xd4)i\0xd2\0xbb\0x14\0xfaK\0xaa\0xda4\0xaa:\0x1a\0xfb\0xcbU\0xaa\0xfa;\0xb5\0x1a\0xaa\0xf4\0xf4\0xbb\0x85\0xca\0xaaT\0xaa\0x1a\0xba\0xd4\0xba\0xd4
\0x1a
k\0x1aj\0xba4\0xbb\0xf4t\0xf4\0x9b
\0xda\0xf4\0x8b\0xaa\0xd4\0xba\0xea\0x1a\0xca\0xaa\0x1a+\0xeb\0x00

Serial terminal settings are correct and I used the same settings before. (115200,8,N,1)

Also tried other baud rates just in case, but no luck.

Something wrong with bootloader?

Thanks in advance.

Re: Serial data won't make any sense

are you using the right voltage?

Re: Serial data won't make any sense

For rs232, the board, IC and adaptor are what I had used before to install ddwrt and then openwrt.
Just in case I also tried a usb-serial converter.

But in these configurations I only used the RX, TX and GND pins, not the 3.3V pin.
This is what I did before and succeeded. USB-serial converter also has 3 I/O as RX, TX and GND.
Do you think this might be a problem?

4 (edited by cornelus2009 2012-03-01 10:12:16)

Re: Serial data won't make any sense

try to change caracter encoding, i see those caracters with winvi , in utf-8 mode

change to ansi in hyperterminal or putty aplications

Burlacu Cornel
Romania

Re: Serial data won't make any sense

Unfortunately changing character sets didn't work.
Before, I was using "cutecom" to get serial data but it does not support to change character encoding.
Changed to "putty" and "screen".
Screen does not change encoding either but I set putty to translate character set to latin1.
It still prints some weird characters.

Might there be any problem with hardware?
As I said it failed during sysupgrade. There must not be any problem with hardware imho.
I'm stuck with LAN cable since the router not working.
If you have any idea,  please help me.

Re: Serial data won't make any sense

By chance is it the WZR-HP-G300NH2 ? If so I noticed on new models that are shipping with sticker code A1 A0 the serial port doesnt work. I'd like to figure out how to get the serial working on the WZR-HP-G300NH2  A1 A0 models .

Re: Serial data won't make any sense

Make sure the USB to serial converter being good by connecting TX to RX and test with PuTTY.

Then, connect the converter to the router.

Pin 2    GND     to adapter GND
Pin 3    TX    to adapter RX
Pin 4    RX    to adapter TX

Re: Serial data won't make any sense

I have a Nokia DKU-5 cable that emits the same problem when used on a Linux desktop computer (with minicom) and not a WinXP computer. The cable used to work on both platforms when the Linux desktop computer was running on a Linux kernel v2.4.x (under Debian 3.1). If there is a way to configure minicom to change the settings to use UTF-8 mode, I sure would like to give that a try.

Mazi

Re: Serial data won't make any sense

WZR-HP-G300NH Rev:V1   ,   21514WG300NH1A1 Rev:A1   written on the board. And there are A0 A1 on the sticker backside. This one is one of those problematic Japanese ones. But that problem has been overcome for 2 years. And I successfully installed DDWRT and OpenWRT on this router before. This time something went wrong during sysupgrade.

First I used the same serial interface that I used before to install OpenWRT successfully. Then I tried a USB-serial adaptor.
And today I tried another usb-serial adaptor. It seems there is no serial output from the router anymore.

When I plug it in, first LED1 is on, then blink all the LEDs together, then LED1 and LED2 stay on permanently. Also after a couple of minutes the metal cooler becomes slightly warm.

I'm afraid it's totally bricked but trying to find a way to make it live again. Because even if I buy a new router (I can't buy the same one because it's too expensive), I won't be able to use my external hard-drive which is formatted ext4. That's why I want to save this and use OpenWRT again.

Re: Serial data won't make any sense

Now I tried on a Win7 too. This time I used bot usb serial adaptor and rs232 together.

From router to rs232 and from rs232 to serial-usb adaptor.

Putty prints strange characters out, in this configuration. For instance;

   

èÿò     þäàÿÿõ…¡-àQ›
                    ýÿ
                      ¡?úü ø¸ø(ÿúþÿóèüÿÿý[eðý0*ÿÿUêÿà÷åýüÓþ
                                                           ÿõúÿÿÒÿ
                                                                  ÿøÿøóÿøêýûö'ÿÿýüÿþýûëýZðý ýAÿ(ü¨Àÿª!ÿ¸à
                         ýý!5ýåýÿýÿþêýý¸ýøúCýA ÿý(ÿ&þýúÿAý…ÿÿûõýÿ'ÿA|à¸üÿ ü©þÿÿÿ¨úùõúõÿúýýúþ ÿ
         ÿíùàõøú?ýMÿúåþ`ý9ýÿú€ÿÿÿÿþ ÿ   ÿûÔýýqüà þüþÿ¤sýþµþøûý—úÿÿÿÿõ @ûêÿ¥ÿ_ò!üÿÿÿÿü¤ýÿÿÿÿÛxÑÃÿýú ýúÿô èªÿúýäÿþ¸ÿÿÿÿÇÿÿÿþ ÿáÿöÿþmñýàýÿúÿ ¸}ÿÿýÿÿýôäà×êýþý þüÿýøýîÿÿÿS0ÿÛúþüÿÿüá“+ÿÿþÿÿøÿ ‘ÿú•uSÿÿÿïÿâÿÿþ苽ÿA÷üÕðÿú#ü#ûÿïàPÿÿ÷ÿEûÿ„Aýý! Dðûùÿÿ"ÿúÿÿ ý9ÿÀúÿ”ÿÿÿÂúþþüýR
                      ÿè;±G»ÿüÿûøÿúúüÿ¬ýÿÛWWüÿÐÛMÿþþÿÿþÿS*ÿþÿ·ßÿ ¿ýÿÿýèEþý ýÿüþþÿýÿúýðþÿñÛü÷Aý«ýýýõÿÿü÷þøAýûÿÐ(ÿà*AÈSæðºÿüÿ[¬ýI÷3÷;ÿ(è?àýÕêöÿ¨ÿýúý‘ /ýýý„ø»êÿúÿÿÿÿÿÿÿúÿÿÿÿÿª[äòÿÿ{ÿþÿÿËÝOï€ÿÿ_úöüÿÿüÿâýøüôü ÿÿäÿßûÿü ÿÿÿÿöÈý+ø¨…ýýü÷ÿ •á"ÿþþýÿýèÿ…ÿÿÿúÿÿøûÿþüýÿÿÿ€ÿ:ÿÿ±ÿþþüüÿýûÿüþüÿÿÿüÿþÿÿЪQúþ_øþÿÿÿÿ½ ÿõ    üûÿÿÿÿÿÝÿÿô "ôàúÿüýþ ÿáÿþÿÿýÿÿý%ßÿ°úý$_úÿÿýÿüèüÿùÿþÛÿÿþÿÿýÿÿþúÿÿýý èñ@Aþ_üJÿüÿA€tWýàšÿùþtÿÿû
                                                                            ÿÿÿÿÿþ0êúÿòÿøÿþúÿýÿüÿÿ?ýÿþÿùü³°þýùÿ¨ÿÿÿþèé ÿ•¿

I tried changing encoding too but it just made the characters to another weird ones.

Re: Serial data won't make any sense

Today I tried with a brand new usb-serial converter too, but nothing comes from the router anymore.

But when I try to put something from computer to router over tftp, the transfer goes smoothly. (but I don't know what happens at the router side since I can't see anything from the serial port.) This made me think that the bootloader is alive but there is something wrong with the filesysytem. Am I wrong?

If it it so, how can I reflash the filesystem without using the serial port? I just can push the bin file to the router but that doesn't work.

Any comments please?

12 (edited by Zgembo 2012-05-15 14:01:14)

Re: Serial data won't make any sense

Seems like some models of WZR-HP-G300NH2 and its Japanese variant WZR-HP-G302H have "special" u-boot version. Serial is disabled in u-boot 1.08. Only blind TFTP flashing of OpenWRT will enable serial in kernel boot stage and afterwards.

Can someone please provide binary copy of WZR-HP-G300NH2 u-boot and u-boot-env 1.03 partitions? In my case these correspond to:

u-boot       - 256kB - mtdblock2
u-boot-env   -  64kB - mtdblock3

I'd like to try flashing u-boot v1.03 to one of these boards to test above mentioned theory...

Re: Serial data won't make any sense

Zgembo, How do you export and import the partitions that you are looking for ?

Re: Serial data won't make any sense

Thanks to all these nice people who provided the files. Initial findings suggest:

WZR-HP-G300NH2 A0 A1 comes with u-boot 1.03, which is unlocked
WZR-HP-G300NH2 A1 A0 comes with u-boot 1.08, which has disabled serial console
WZR-HP-G302H (Japanese variant) A1 A0 also comes with u-boot 1.08, which has disabled serial console

Also, it seems that WZR-HP-G300NH2 A1 A0 and WZR-HP-G302H A1 A0 are identical hardware, as both are shipped with dual 16MiB SIP flash ROM, with erase bock size of 64k.

Re: Serial data won't make any sense

Zgembo, Is it possible to load u-boot 1.03 onto u-boot 1.08 essentially downgrade to get the serial console enabled ? Or this being blocked by hardware.

Re: Serial data won't make any sense

Now, that you had asked, this is getting interesting. I was just playing with my WZR-HP-G302H (most probably identical to WZR-HP-G300NH2 A1 A0), and there is an easy way to enable u-boot serial console, without flashing u-boot 1.03. At 1.08 u-boot checks for presence of new u-boot-env variable, "force_uart", which, when set to true, enables u-boot serial console! Just tested and it worked. But, you need a way to set this variable, on OpenWrt one needs to have fw_setenv & fw_printenv (package uboot-envtools), and a config file describing a flash layout at /etc/fw_env.config. Also, beware that incorrect fw_env.config when using fw_setenv may lead you to a total brick, so do this at your own risk. Also, there is a way to set u-boot variables from stock firmware and DDWrt. I am about to put some more details at WiKi.

And again, thanks for all the people that had given me a chance to look into u-boot binaries, i wouldn't be able to find out about this buffalo BS without you! Now, i wonder what is the next BS they are planning, maybe a hardware encrypted data on serial?

Re: Serial data won't make any sense

Zgembo,  I installed the uboot-envtools and I can print everything in uboot.  But fw_setenv didn't get installed.  Would you happen to know how to get fw_setenv installed ?
If I do figure out how to get fw_setenv going. You state to enable force_uart to true. Could you provide the syntax you used please.

Also I look forward to your instructions on how to do this from dd_wrt.

Re: Serial data won't make any sense

fw_setenv is actually the same binary as fw_printenv. Maybe by default a symbolic link to fw_setenv -> fw_printenv is not set? There is an option somewhere in menuconfig if you compile your FW from source. You can always set it manually later on. But be 100% sue that your fw_env.config is correct before you proceed, you may end up with brick otherwise. Syntax is same one used for accept_open_rt_fmt trick...

Re: Serial data won't make any sense

Zgembo, I have confirmed that this works thanks !
USA - WZR-HP-G300NH2
Sticker A1 A0

Serial Starting with 106F

My steps

1.) opkg install uboot-envtools

2.) Made changes to 
vi /etc/fw_env.config

root@OpenWrt:~# vi /etc/fw_env.config
MTD device name Device offset   Env. size       Flash sector size
/dev/mtd0               0x40000         0x10000         0x10000

3.) Created SymLink  as mentioned in wiki -- http://wiki.openwrt.org/toh/buffalo/wzr-hp-g300h#locked.u-boot.too.short.time.tftp.window
ln -sf /usr/sbin/fw_printenv /usr/sbin/fw_setenv

4.) Ran command to enable Serial Output
root@OpenWrt:/sbin# fw_setenv force_uart 1
root@OpenWrt:/sbin# fw_printenv force_uart
force_uart=1

Re: Serial data won't make any sense

From DD-WRT

root@DD-WRT:~# ubootenv set force_uart 1
root@DD-WRT:~# ubootenv list