OpenWrt Forum Archive

Topic: HOWTO: reflashing from openwrt (2nd post)

The content of this topic has been archived on 21 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I wanted to reflash my wrt54g (v1.1) with Linksys's firmware, but am having trouble. I have boot_wait on and I can get most of the file onto the wrt54g, however, tftp starts to hang and eventually times out. I even tried setting timeout to 600. It gets to:

sent DATA <block=6169, 512 bytes>
[...]

And just keeps repeating that until it times out. So it looks like it is getting close, but not quite finishing. Has anyone else seen this problem or have any ideas about what might be happening?

edit: Oh, when this happens I have ended up cycling the power at which point openwrt comes back up.

edit: One more thing. This is the firmware from Linksys I was trying to reflash with. WRT54GV2_3.01.3_US_code.zip

Thanks!

(Last edited by winter on 17 Jun 2005, 20:53)

The linksys firmwares can be too large for the tftp server to handle at boot_wait; it's eaiser to log into openwrt, wget the binary into /tmp, remove the first 32 bytes of the bin to make a trx file (dd if=firmware.bin of=firmware.trx bs=32 skip=1) and then write that directly to flash (mtd -r write firmware.trx linux).

Excellent! Thanks for the reply. I will try that as soon as I can.

Jackpot! Thanks again.

Just to make sure...  I can do the same with the Dell Truemobile 2300 stock firmware, right?  I need to get back to the old firmware to have it reset the NVRAM to the defaults.  The tftp isn't working so well for me.

mbm wrote:

The linksys firmwares can be too large for the tftp server to handle at boot_wait; it's eaiser to log into openwrt, wget the binary into /tmp, remove the first 32 bytes of the bin to make a trx file (dd if=firmware.bin of=firmware.trx bs=32 skip=1) and then write that directly to flash (mtd -r write firmware.trx linux).

hi!
is this also a common way to flash a new version of openWRT on a WRT54GS V1.1 hardware?
greetings,
treb

hey!
I tried all this but my problem is, where do I have to put my .bin files (later after dd command trx files). So what folder do I have to use to put the firmware in. The router says they can't find the file in the directory, so, maybe someone knows where I can store my firmware.
In /tmp tells the help file, but that's the tmp in the router. So how do the router knows where he can read the firmware files when they are on my harddisk??

Also, should I use a cable when i'm reflashing my router with tftp? Because the router WLAN is not usable during the bootup. I use this command: tftp -i 192.168.1.1 put WRT54GV4.0_4.20.6_US_code.bin ( the bin file is only 2.8 MB!)

greetz,
ryen

(Last edited by Ryen on 11 Aug 2005, 21:25)

You have to download the bin into /tmp on the WRT: using wget. wget downloads from a webserver, so either make a webserver from your own PC or upload the bin somewhere (or try to find a bin of the firmware you need on the internet).

If your current OpenWRT version is new enough, you could also try the scp command (either on the WRT itself or from some other PC).

Ok, making a webserver is new to me, but I can't find any firmware in .bin format. Only .zip (on my harddisk are .bin's but then i've to make a webserver!) So, maybe someone can set any wrt54g v1.1 firmware on his site so I can download it from there please??

I placed a file on a freewebssite:

http://www.freewebs.com/nbkvc/WRT54GV4. … S_code.bin

I typed this: wget -c http://www.freewebs.com/nbkvc/WRT54GV4. … S_code.bin

but then he says 'unkown host' sad

So, what i'm doing wrong??

Ryen wrote:

but I can't find any firmware in .bin format. Only .zip (on my harddisk are .bin's but then i've to make a webserver!)

LOL. You made my day.

(Last edited by olli_04 on 12 Aug 2005, 13:31)

lol,

but if i do: ping yahoo.com or something, he's always saying unknown host.
I searched on inet but i can't find anything. Please tell me what the problem is...
thanks;)

(Last edited by Ryen on 12 Aug 2005, 13:50)

Check

/tmp/resolv.conf

It should contain something like this:

nameserver 62.108.1.65

Is the internet connection working at all? try

ping 62.108.1.65

Ryen: it's obvious that your WRT54G is not able to access the Internet to d/l the file. Try hosting it on an FTP server on your LAN to avoid all that complications.

use slimftp on wincomputer, wget then

Sorry. I've downloaded the trx file on my hd. How can i copy it in the tmp di of the router?
I already tried to do wget -c http://... directly from the web site but it gaves me an input/output error.
Thanx for help.

if your openWRT installation is new enough you can try to use scp.

To do this on a Linux computer just do: scp IMAGE.trx root@192.168.1.1:/tmp/IMAGE.trx
Where IMAGE.trx is the name of the image file.  You will be asked for your password and then the transfer will complete.

If you are on a windows computer then you need to download a scp program.  I like the Putty package which you can download the installer for Here.
Once you have Putty downloaded and installed you can open a command prompt and "cd" into the directory where your image file is.  Run the following command:
"C:\program files\putty\pscp.exe" -scp IMAGE.trx root@192.168.1.1:/tmp/IMAGE.trx
Where IMAGE.trx is the name of the image file.  You will be asked for your password and then the transfer will complete.

Hope this helps,
     Duffin

I just installed Apache on my win32 machine (heh).. still I have a virgin v4 router that is pleading for a openWrt install. Having a unsuccessful time installing it.. I'm stuck at the tftp not accepting the version I grapped from the download section (rc2).  In searching the form all I see is use a dd command or build from CVS to solve the problem which means nothing to me because I don't know what DD is or how to download a CVS source and build it. I'm leaving for FL tomorrow to go clean up Wilma's mess so if anyone can PM or give me a link to a how to before then that would be great.

/usr/local/fox

Hello, I'm quite desperate as I write this. I changed the 4.20.7 linksys firmware with the openwrt-wrt54g-squashfs.bin (experimental). The upgrade said success and I can telnet into OpenWRT but I'm stuck there. No web interface (who's laughing back there?!) and no internet connection.
So I'm trying to find my way back home but I have major difficulties. Tftp gives me the dreaded 'timeout occurred' error.
wget isn't an option as my internet connection doesn't work, no local ftp either. Can anyone point me into the right direction to get .trx firmware files for wrt54G ver. 3.1? I will try to putty scp into /tmp. What is the password for openwrt? admin as usual? Thanks in advance

I found one way around the wget or FTP issues is to use scp.  This runs on top of ssh, so assuming you have access to ssh in linux (or a windows variety) you can copy files to the openwrt without any problems.

I found scp from openwrt to my linux box had protocol problems - but the other direction worked fine.

An example:
copying a new trx from my linux box to openwrt:

merry:>scp newfirmware.trx root@192.168.1.1:/tmp/newfirmware.trx

From there follow the instructions to erase the old linux and re-write th firmware with your new load (as elsewhere in the docs.)


Jason

Hello

I wantet to reflash my wrt54gsv1.1. It doesn't respond so I tried the JTAG adaptor method.
So I've downloaded the software and a CFE.BIN file for the wrt54gsv1.1

When I'm running the software with the following parameters:

wrt54g -flash:cfe /noreset /nobreak

it hangs. The only result i get is this:

====================================
WRT54G/GS EJTAG Debrick Utility v4.5
====================================

Probing bus ... Done

Instruction Length set to 8

CPU Chip ID: 00100100011100010010000101111111 (2471217F)
*** Found a Broadcom BCM4712 Rev 2 CPU chip ***

    - EJTAG IMPCODE ....... : 00000000100000000000100100000100 (00800904)
    - EJTAG Version ....... : 1 or 2.0
    - EJTAG DMA Support ... : Yes

Issuing Processor / Peripheral Reset ... Skipped
Enabling Memory Writes ... Done
Halting Processor ... Skipped
Clearing Watchdog ... Done

Probing Flash at (Flash Window: 0x1fc00000) ...

and then it stops here.
I've also tried other optional parameters but it always gets stuck in an early phase of the flash process.
Sometimes the probing of the flash is successful but then it stops at ereasing a block of the flash or in a early stage of the real flashing process.


I don't know what to do next so please help me out.

Thanks a lot!

Magoo

(Last edited by Magoo on 20 Mar 2006, 17:28)

This is my sugestion (WORKED 4 ME)!!!!

I used putty to log into my router and i connected it to internet (trough WAN port using DHCP)

------------------------------------------------------------------------------------------------------------
login as: root
root@192.168.1.1's password:xxxxxxxx


BusyBox v1.11.2 (2008-10-08 15:12:55 UTC) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
|       |.-----.-----.-----.|  |  |  |.----.|  |_
|   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
|_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
KAMIKAZE (8.09, r13118) ----------------------------
  * 10 oz Vodka       Shake well with ice and strain
  * 10 oz Triple sec  mixture into 10 shot glasses.
  * 10 oz lime juice  Salute!
---------------------------------------------------
root@OpenWrt:~# ls
root@OpenWrt:~# dir
-ash: dir: not found
root@OpenWrt:~# cd ..
root@OpenWrt:/# cd tmp
root@OpenWrt:/tmp# wget http://www.dd-wrt.com/dd-wrtv2/download … p1/Consume
r/Linksys/WRT54GL_1.1/dd-wrt.v24_mini_wrt54g.bin
Connecting to www.dd-wrt.com (83.141.4.210:80)
dd-wrt.v24_mini_wrt5 100% |*******************************|  2841k 00:00:00 ETA
root@OpenWrt:/tmp# dd if=dd-wrt.v24_mini_wrt54g.bin of=dd-wrt.v24_mini_wrt54g.tr
x bs=32 skip=1
90911+0 records in
90911+0 records out
root@OpenWrt:/tmp# mtd -e linux -r write dd-wrt.v24_mini_wrt54g.trx linux
Unlocking linux ...
Erasing linux ...
Writing from dd-wrt.v24_mini_wrt54g.trx to linux ...  [w]
Rebooting ...

----------------------------------------------------------------------------------------------------------

THATS IT!

I used WRT54GL v1.1

wink
Peter

(Last edited by djpero on 8 Jan 2009, 15:00)

Ok,

So I must be missing something here, I tried reflashing my WRT54G but am getting an error instead. Below is an extract of my ssh session;

----------------------------
root@OpenWrt:~# dd if=dd-wrt.v24_mini_wrt54g.bin of=dd-wrt.v24_mini_wrt54g.trx bs=32 skip=1 
91295+0 records in
91295+0 records out
root@OpenWrt:~# mtd -r write dd-wrt.v24_mini_wrt54g.trx linux         
Could not open mtd device: linux

----------------------------
I'm going to retry using a Linksys and OpenWRT bin to see if I get the same message. I'll update the post with results

EDIT: Tried using the Linksys firmware and got the below results;

BusyBox v1.4.2 (2007-09-29 09:01:24 CEST) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
|       |.-----.-----.-----.|  |  |  |.----.|  |_
|   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
|_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
KAMIKAZE (7.09) -----------------------------------
  * 10 oz Vodka       Shake well with ice and strain
  * 10 oz Triple sec  mixture into 10 shot glasses.
  * 10 oz lime juice  Salute!
---------------------------------------------------
root@OpenWrt:~# ls
WRT54GV4.0_4.20.7_US_code.bin  resolv.conf
dhcp.leases                    run
lock                           spool
log                            state
root@OpenWrt:~# dd if=WRT54GV4.0_4.20.7_US_code.bin of=WRT54GV4.0_4.20.7_US_code.trx bs=32 skip=1
90143+0 records in
90143+0 records out
root@OpenWrt:~# mtd -r write WRT54GV4.0_4.20.7_US_code.trx linux
Could not open mtd device: linux

(Last edited by seriald on 25 Jan 2009, 21:18)

partition name can be different.  view with: cat /proc/mtd

The discussion might have continued from here.