Flash process breaks down - "Service not available" (Fritzbox FTP transfer)

Helo,

I try to flash Fritzbox 4040 with the file
openwrt-18.06.4-ipq40xx-avm_fritzbox-4040-squashfs-eva.bin.
Fritzbox has been completely resetted before.
Everything runs fine at first until
"„227 Entering Passive Mode (192,168,178,1,12,0)“,
but then an error message is displayed:
„421 Service not available, remote server timed out. Connection closed.
ftp> quote check mtd1
Not connected."

Anybody who can tell me what is wrong and how to solve this problem? Thanks in advance.

You are not talking about flashing, but about FTP transfer...

AVM devices start a limited ftpd for a short time from the bootloader (ADAM2)[0], which is meant for their windows based recovery programs, but can also be entered with cli ftp clients. This access method is used for flashing OpenWrt on these devices - and yes, it's really (a subset of) ftp, not tftp.

Edit: The tricks are:

  • to hit the right time for invoking the ftp session, as there's only a very small time frame to catch (1-2s during the early boot process, while the bootloader/ ADAM2 is in charge).
  • to only use passive ftp (if your ftp client allows setting this via cli parameter that might be better/ quicker than invoking pasv at runtime).
  • to provide the login credentials (adam2/ adam2) as quickly as possible, as only an established ftp session (login succeeded) intercepts the normal boot process.

it will usually require several attempts to hit the right timing, adding an unmanaged switch between your router and client can help to reduce the time needed for link training.

Once your ftp session is active, you can switch to binary mode, invoke the custom quote MEDIA FLSH command and put the required firmware components directly to the relevant mtds.

--
[0] this ftp window is open during every single boot, it doesn't require pressing any buttons (there are no reset buttons)

2 Likes

Thanks a lot for reply.

Well I know of course there is a short time range you have to hit.
In addition to my post above I can say that I succeeded to hit this when I tried to flash OpenWrt to the Fritzbox the first time.
But as described all ran fine at first but the last step - the flash process itself - didn’t work and has stopped as mentioned above.
After that the box was in disorder and I had to run the rececovery.exe file published by AVM.
Now trying again to flash I could hit the right interval no longer in spite of trying again and again, but had read a good trick before:
Running a wrong recovery file - for another Fritzbox, not the 4040 - in my case in a bridged Windows virtualbox window produces an error message of course, but keeps the ftp-access open.
Now I started the commands line for line as published for OpenWrt and all the commands ran fine again until the confirmation „227 Entering Passive Mode (192,168,178,1,12,0)“. But after a short while again the whole process stopped as quoted above and as happened before.

My host system is OS X Sierra. Maybe it is important to add this.
I can’t recognize any blockings by firewall or other processes, but did disable the firewall for this instead. Fritzbox ist connected to MAC by ethernet cable. Default settings for the box are maintained (IP 192.168.178.1), for for MAC manually set to 192.168.178.2 or by DHCP to 192.168.178.20.

So far I can’t find any faults in my procedure until know and would be very thankful for more help how to cut the knot.