Unable to flash openwrt in AVM Fritz!box 4040 (with 7.10 original firmware installed)

I have read the instructions in the model's page (https://openwrt.org/toh/avm/avm_fritz_box_4040).
It should not be all that difficult, as you upload it via simple ftp commands, but it did not work..

First of all it is quite difficult to get connect using ftp to the router at the right moment.

If you do it to late, it is up and running and you get connection refused errors, too early and it does not respond.

The original firmware was upgraded to version 7.10 in my router, may that is causing some problems.
I am using windows 10.

First of all "ftp -n -p" does not work in my windows machine, -p option is unknown.

I guess -p option is for passive mode, which is anyway given as a command.

The couple of times that I could get into it, it did not worked, either.
I gave this instructions which work correctly:

quote user adam2
quote pass adam2

But if I use "put firmware.bin mtd1" I receive the error "502 unknown command".

passive command is not known, either.

I have tried to use
quote pasv

which works and enter passive mode.

But when I use:
put firmware.bin mtd1

it keeps saying "502 unknown command" blocks for a long time and there is no message telling you the transfer is complete.

Now I cannot connect using ftp command anymore, as it allays rejects connection.
If you wait too much it says that it does not accept connection.

Sometime it responds just before the LAN led is lit.
But it says that the software has cancelled connection after initial connect.

At the end of the device page in openWRT there is a link to an python script used to upload gluon firmware to Fritzbox.

I have tested it. It repeatedly tries to connect to the router while it is booting until it gets a connection, and then uploads the given firmware.

I use "python fritzflash.py --image openwrt.bin".

It gets connection and it uploads the firmware and tells you everything is OK, but when the router reboots, it blocks flashing the red info led.

Reading the python script it seems that it does not a "put openwrt.bin mtd1" coomand, but "quote STOR mtd1" and after that ir writes de binary file.

But something does not work. The script itself tell you that 4040 model has problems with this script.

I had to revert to the original firmware.
The toot from AVM to reflash, seems to erase mtd1 prior to flashing, and it seems that it writes some other partitions, mtd2... mtd4.

How can I flash the firmware?

May be that they have made some changes in version 7.10 and have dropped put command from the ftp server?

Thank you for your advice.

If you have no access to Linux machine you may try a virtual machine, or possibly a Linux shell for Windows.

You may also try WinSCP and see if it allows you to copy the file to the box.

1 Like

Thanks for the suggestions.

I have tried both.

I have installed Debian under Windows WLS, an the used apt install ftp to get a Linux ftp version.

Now connect to the lan from the Debian shell and to any internet ftp server.

And the command "ftp -n -p" works now.

But I could not ftp to the fritzbox while booting.

I have reset fritzbox 4040 to factory settings.

I have disconnect any LAN ethernet cable and connected it directly to my PC in LAN port 1 (I have tried WAN too).

I have set my PC to IP address mask .

I boot my router and run and wait POWER let to flash 5 times slowly.
Then when it blinks again I run the command

ftp -n -o

But get no route to host as response.

If I wait a bit more, I get "host unreachable".

If I run it prior to that I get a timeou.

I have installed WinSCP but it did not connect either.

I have stablished passive connection and a time out of 200 seconds.

It does not get connected.

But the app for return the router to factory firmware works.

And the python script does get connected.

Any idea?

No need for that.

Have a look at this Fritz!Box 4040 [Solved] It might not answer your question, but you may contact the guy who topic author and ask them if there is a trick with getting the router in the ftp mode.

1 Like

Try with (ftp) and set your linux vm to /24

1 Like

I have been able to connect from the Linux shell.

It seems that I was waiting too much, you have to do the ftp when the power led blinks slowly the first times.

The ftp command and the put command in the Linux machine works, the problem weems to be with the windows ftp commands.

I will comment it there in order to improve the instructions and add the workarrond for windows users.

BUT I have another problem now, when it finishes and i make the check command, the router seems to reboot before finishing the check, it does not give the checksum.

And it does not start up correctly, the info red led blinks.

I will try again before reporting it in that page.

Thanks a lot.

Finally I could get it to work.

I do it all again and this time it worked.

Thanks a lot. I have it running now, and configured.

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