Firmware upload times-out between PuTTY and atftp on bricked router

Hello, and thanks for the help.

Short version:
I bricked my WRT3200ACM router.
I'm not able to recover/restore the router through its Ethernet port; but I am able to access it though its serial port.
Unfortunately, when I try to upload the firmware, my "atftp" client and PuTTY both time-out.
I don't know what I'm doing wrong. I'd appreciate any pointers.

Long version:
I bricked by Linksys WRT3200ACM router while trying to restore the OEM firmware (replace OpenWRT).
I tried the recovery instructions below, but they failed:

I located several guides on how to debrick a router using the routers serial port:

Following these guides, I successfully connected to the router through its serial port using a PuTTY terminal.
I tested the Ethernet and serial port connections:

  • The computer can ping the router.
  • The router can ping the computer.

So I now have a 2-way connection between the router and the computer, and I can configure both the computer and the router.

Unfortunately, when I try to upload the OEM firmware, both "atftp" and "PuTTY" time-out.

Below is my detailed procedure:
Power "off" BRICKED router and disconnect all cables.
Connect WORKING router to computer Ethernet port.
On computer, install FRESH minimal Debian Buster with user "Tom".
First boot: CLI Login as root.

apt update
apt full-upgrade
apt --yes install <cpu microcode package>   #CPU microcode
apt --yes install <graphics driver package> #graphics drivers
apt --yes install sddm                      #simple desktop manager
apt --yes install kde-full                  #full KDE (including ssh & network packages)

apt --yes install atftp     #ftp client used to upload firmware to router
apt --yes install putty     #terminal program used to access router though its serial port

usermod -aG sudo tom                        #add user "tom" to "sudo" group

vi /etc/network/interfaces                  #set static computer IP address to
#iface <LAN ethernet adapter> inet dhcp
 iface <LAN ethernet adapter> inet static

shutdown now

Disconnect WORKING router from computer Ethernet port.

Make sure that power to BRICKED router is "off".
Connect "Ethernet cable" between "computer Ethernet port" and "BRICKED router LAN port #1".
Connect "USB to TTY cable" between "computer USB port" and "BRICKED router serial port".

GUI Login as tom.
Copy Linksys OEM firmware to "~/linksys/linksys.img" from USB stick.

Computer terminal #1: #connect to the BRICKED router through its serial port

sudo putty
    Connection type: Serial
    Serial line:     /dev/ttyUSB0
    Speed:           115200

Power "on" the BRICKED router.
PuTTY terminal: #configure the BRICKED router to receive a new firmware image.

"Hit any key to stop autoboot: 3" <SPACE-BAR>
ping                  #verify that router is connected to computer
setenv ipaddr
setenv serverip
setenv firmwareName  linksys.img
run update_both_images            #start "listening" for an upload (quickly do the commands below)

Computer terminal #2: #start the firmware upload from the computer

hostname -I                 #verify static computer IP address
ping -c 1       #verify that computer is connected to router
cd ~/linksys
sudo atftp --option "mode octet" --verbose -p -l linksys.img #start upload

Below are snapshots of outputs of the 2 terminals (Computer terminal and PuTTY terminal).

tom@debian:~$ hostname -I 
tom@debian:~$ ping -c 1
PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=64 time=0.056 ms

--- ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.056/0.056/0.056/0.000 ms
tom@debian:~$ cd ~/linksys
tom@debian:~/linksys$ sudo atftp --option "mode octet" --verbose -p -l linksys.img
[sudo] password for tom: 
Option mode = octet
Verbose mode on.
timeout: retrying...
timeout: retrying...
timeout: retrying...
timeout: retrying...
timeout: retrying...
timeout: retrying...
tftp: aborting

The router and the computer can ping each other;
but they can not exchange a file.

Any pointers appreciated.

firewall blocking the img file from being DLed ... ?

Usually this is a permissions problem, but yeah your firewall might interfere too. First thing to try would be to see if you can download the image locally on the system you're running the TFTP server on.

If you can't get it to work, you can resort to ckermit to transfer the file over serial (slow, but works).

Hello frollic and Borromini,
Thanks for your responses. I appreciate it.

My previous posting was getting long, so I left out some tests:
The reason I did a fresh OS install was to minimize firewall and permission issues.
In my earlier tests (on my normal machine), I disabled the firewall (sudo ufw disable) and removed all firmware file permission blocks (chmod 0777 linksys.img). That failed. I tried two ftp clients ("tftp" and "atftp" clients). That failed. I scoured the internet for a similar case to mine. That failed. So I tried a completely fresh OS install. That also failed.

It's frustrating that I can ping both ways, but I can't transfer.

Are there permissions within the router OS that I should examine?

Borromini: you also suggested ckermit. After reading ""; it's clear that I'll need to be VERY careful going that route. If you have any guidance, I'd appreciate it.

I was hoping that the resolution would be something simple, and that I'd just feel stupid for missing it.

Thanks for the help.

You could study [Solved] How to I revert to Factory Image on WRT3200ACM

From all the logs I've seen here so far, it appears that you need to serve the initramfs firmware image from a tftp-server, not upload it actively from a tftp-client.

Package: atftp
Description: advanced TFTP client


Package: atftpd
Description: advanced TFTP server

(personally I prefer tftpd-hpa for this particular use case though)

1 Like

Hello frollic,
Thank you for the link.
Unfortunately, I've tried power cycling and ssh login.
They failed.
Thanks for taking a shot.

Hello slh,
I spent this morning testing an ftp server (vsftpd).
It also failed.
Thanks for the suggestion.

ftp != tftp

1 Like

I unbricked my modem!
In the PuTTY terminal over the serial link to the modem: "run altnandboot" brought one of the images back to life. I immediately installed a fresh image into the alternate partition.
I got this approach from reading:

I still don't know why I can't get ftp working (client and server both failed).

Thanks everyone for your suggestions and observations. I really appreciate your efforts.

As frollic already pointed out, tftp and ftp are different protocols, likewise tftp and tftpd are different ends of the same protocol.

1 Like

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