Using TFTP to install openwrt on Aterm WR9500N

I'm trying to install openwrt on WR9500N. There are some blogs online that claim to have done so (namely this one and this one), but their instructions aren't comprehensive. Since I had no luck using the OEM gui to load the factory.bin, I decided to use TFTP.
I followed this official tutorial, and got tftp working on my laptop port 69, but there are no further instructions. I decided to take a look at an example using other router (tp-link), and added verbose option to /etc/default/tftpd-hpa and see the log using grep tftp /var/log/syslog to figure out if, and which file the router is requesting, but to no result.

I have also opened up the chassis to look for a UART port, but couldn't find what looks like to be. What options do I have?

I am using an image from https://taiha.net/jenkins/job/OpenWrt-master-NEC-BSD-Aterm/ since I could not find one in the official site.
My laptop is on Xubuntu 20.04

try finding the serial port, seems it's the way of doing it.

post a photo of the PCB, if you'd like to.

There is no official support for NEC Aterm WR9500N, the support is my personal work. And, there is no plan to send patch to the official repository in the future.

To install OpenWrt, there is no factory image to flash from OEM webgui and you need to use tftp client instead of server. And, the official bootloader need to be replaced to the modified u-boot_mod for booting OpenWrt from the flash.

2 Likes

Bad news, After soldering those three pins to wires, I accidentally twisted the RX wire and the copper substrate came out, and it will not solder back on. Even without this, when I connect TX and GND to my serial usb converter, nothing comes up on the serial monitor. I tried the same setup with other routers too, so I'm sure the problem is not on the converter.
The OEM web-gui is working fine though.
(Just to be sure, I've just been assuming TX is router->PC, and RX is PC->router. am I correct?)

Hi @musashino,

First of all I would like to thank you for the work you have done on the integration of OpenWrt on many routers in Japan. This give me the opportunity to learn more about it.

I recently bought a NEC Aterm WR9500N at a very low price on a second hand shop and decided to flash it with OpenWrt.

I followed your tutorial here https://speakerdeck.com/musashino205/spring-aterm-and-openwrt.
And everything worked fine until the U-boot, where a password is requested (slide 17).

I also read here Support for NEC WG2600HP (ipq806x) - #13 by wg2600 that you have a technique to bypass the U-boot password.

Would it be possible to tell me more about it? Because I can't find any information about this issue on internet.

Thanks

The password of the original bootloader is provided as for WR8175N on the old OpenWrt's thread on 5ch.net.
Search "wr8175n skyu-hp site:5ch.net" by Google or anything.

BTW: The original bootloader is not a U-Boot.

Awesome thanks a lot!

Yes you alright, boot console if you prefer :slight_smile:

Hi @musashino,

I've made a small progress since this morning but I have another issue, for some reason it seems the service "start tftp" is not available in my boot console.

IPL:HARD-RESET
memory test ... ok
flinstall OK

boot version: 1.0.0

PKG "ISNER"
CPU "Atheros/AR9344"
Revision 212.1 CLOCK 560.0 MHz
HEAP MEMORY 262144 bytes
Boot:InitFilesystem

welcome to boot console
Password:
Password:
boot> tftpd
phy0.1: "Atheros/AR8327(SW)"
phy0.0: "Atheros/AR8327(phy)"
active ch:0
tftpd start 192.168.0.1
boot> start tftp load openwrt-ath79-generic-nec_wr9500n-squashfs-sysupgrade.bin
start: Command not found.
boot> help
support commands ...
load             load module
boot             boot loaded module
tftpd            start tftpd [tftpd [IP] [bfn]]
dlmode           set tftpd download mode [bfn]
reboot           reboot system
help             help command
macaddr          macaddr read/write
configid         configid read/write
randomkey        randomkey read/write
serial           serial number read/write
pkg_info         show package information
presetid         preset id read/write
version          show boot version
mhx              mhx utility
tp               test program
errorlog         errorlog command
additional       additional command
rf-serial        rf-serial command
time             Time command
debug            debug command
?                help command
boot> 

Do you have any idea?

Also, just to make sure, I've got 3 images for the WR9500N:
First I should use openwrt-ath79-generic-nec_wr9500n-squashfs-sysupgrade.bin
Once it reboot to OpenWrt I should use openwrt-ath79-generic-nec_wr9500n-initramfs-necimg.bin and openwrt-ath79-generic-nec_wr9500n-initramfs-kernel.bin.

Is that correct?

start tftp load ... is a log message by the bootloader and not a command, please send initramfs-necimg.bin image from tftp client.

Thanks for your help.
I well followed your instructions and use the image initramfs-necimg.bin.
But I have got an error somehow ...

IPL:SOFT-RESET
memory test ... ok
flinstall OK

boot version: 1.0.0

PKG "ISNER"
CPU "Atheros/AR9344"
Revision 212.1 CLOCK 560.0 MHz
HEAP MEMORY 262144 bytes
Boot:InitFilesystem
phy0.1: "Atheros/AR8327(SW)"
phy0.0: "Atheros/AR8327(phy)"
active ch:0

welcome to boot console
Password:
Password:
boot> tftpd
tftpd start 192.168.0.1
boot> start tftp load initramfs-necimg.bin
end tftp load length = 6051974
start memory load ... 
load error [5]

There is something wrong?

Did you use openwrt-ath79-generic-nec_wr9500n-initramfs-necimg.bin?

Yes, I am 100% sure.

I've downloaded the image from here:

https://taiha.net/jenkins/job/OpenWrt-master-NEC-BSD-Aterm/lastSuccessfulBuild/artifact/bin/targets/ath79/generic/openwrt-ath79-generic-nec_wr9500n-initramfs-necimg.bin

Hm, I don't know any more. The image may be broken, or something else may be the cause.

I see... Do you know where I can find an older version of the image?
Maybe there is a problem with the last realease of July 17, 2021.

There is no older version than that image.

Okay, how can I debug it to check what's going on?

Did you use "binary" mode of tftp client?
ex (Windows): -i option

It worked!!
The binary mode was the solution.

tftp -m binary -v 192.168.0.1 -c put openwrt-ath79-generic-nec_wr9500n-initramfs-necimg.bin

I've also perfectly installed the U-Boot :slight_smile:
Again, thank you very much for your great work and help!

1 Like

Hi @musashino,

Sorry it's me again and I need your help :sweat_smile:
I've tried to flash another image, but now I get stuck in the U-Boot.

I tried to re-flash the original image but it is not working.

u-boot> reboot
## Error: unknown command 'reboot' - try 'help'
u-boot> 

***************************************
*     U-Boot 1.1.4-ae4d0e98-clean     *
*          Build: 2019-07-05          *
***************************************

  BOARD: NEC Aterm WR9500N
    SOC: AR9344 rev. 1
    CPU: MIPS 74Kc
    RAM: 128 MB DDR2 32-bit CL3-4-4-10
  FLASH: 16 MB Macronix MX25L128
   PCIe: 168C:0030
    MAC: 00:3A:9D:DD:C5:50
 CLOCKS: CPU/RAM/AHB/SPI/REF
         550/400/200/ 25/ 40 MHz

Hit any key to stop booting:  0

Booting image from 0x9F040000...
## Error: unsupported image header

## Error: failed to execute 'bootcmd'!

u-boot> tftpboot 0x80800000 openwrt-ath79-generic-nec_wr9500n-squashfs-sysupgrade.bin
      TFTP from IP: 192.168.0.2
      Our IP: 192.168.0.1
      Filename: openwrt-ath79-generic-nec_wr9500n-initramfs-necimg.bin
      Using: eth0
      Load address: 0x80800000

     Loading: T ########################################
              ########################################
              ########################################
              ########################################
              #################T #######################
              ########################################
              ########################################
              ########################################
              ########################T ################
              ########################################
              ########################################
              ########################################
              ###########################T #############
              ########################################
              ########################################
              ########################################
              ########################################
              ########################################
              ########################################
              ########################################
              ########################################
              ########################################
              ########################################
              ########################################
              ########################################
              ########################################
              ########################################
              ########################################
              ########################################
              #############

TFTP transfer complete!
Bytes transferred: 6005096 (0x5ba168)
u-boot> boot
Booting image from 0x9F040000...
## Error: unsupported image header

u-boot> printenv
bootcmd=bootm 0x9F040000
bootdelay=1
baudrate=9600
ipaddr=192.168.0.1
serverip=192.168.0.2
autoload=no
hostname=u-boot_wr9500n
bootfile=firmware.bin
loadaddr=0x80800000
lsdk_kernel=1
stdin=serial
stdout=serial
stderr=serial
ethaddr=00:3A:9D:DD:C5:50
ethact=eth0

Environment size: 262/4092 bytes

You need to use initramfs-kernel.bin image instead of initramfs-necimg.bin on the U-Boot. And, please use bootm after transferring by tftp.