It was a challenge to get openwrt installed on my fritzbox wlan 3370 (https://openwrt.org/toh/avm/fritz.box.wlan.3370).
While it was quite easy to get access to the bootloader ftp server of my fritz 4040, it was a challenge to catch the time slot of the ftpd of the 3370. But here is help: "eva_discover" from
I downloaded YourFritz completely as zip (YourFritz-master.zip) and opened it in my work directory. I had to fix it a little bit for my use by replacing parts in the last block (lines 421 downwards). This is roughly done but it worked within seconds. If you compare it with the original script (which produced an error I do not remember) you see that I
a.) shortened the if condition
b.) hard coded the ip
c.) added "exec lxterminal -e 'ftp 192.168.178.1'"
if [ ${#response} -gt 0 ]; then
# we assume, that the LE value of 2 above represents an answer and
# if it's found, we assume the next 4 bytes are the IPv4 address
# in LE format
ip=192.168.178.1
echo "EVA_FOUND=1"
echo "EVA_IP=$ip"
exec lxterminal -e 'ftp 192.168.178.1'
if [ $default_hold -eq 1 ]; then
echo | socat TCP4:192.168.178.1:21 STDOUT 2>/dev/null 1>&2
echo "boot sequence interrupted" 1>&2
fi
rc=0
else
echo "EVA_FOUND=0"
rc=1
fi
exit $rc
I started my version of "eva_discover" on an lubuntu 18.04 after having installed the socat package.
./eva_discover INTERFACE=enp0s25 FROM=192.168.178.7 TO=192.168.178.1
Then I powered the 3370 on. As soon as the ftp server was detected the ftp client tool opened in a new terminal. In the beginning I was too slow issuing the commands (login, password, changing modes ...) (see https://openwrt.org/toh/avm/fritz.box.wlan.3370). I created an .netrc configuration file that took over some of the commands:
my ~/.netrc
machine 192.168.178.1 login adam2 password adam2
macdef init
binary
passive
debug
Be careful: It ends with an empty line!
I prepared the other commands in another file :
quote SETENV linux_fs_start 0
quote MEDIA FLSH
put /home/lubuntu/FRITZ/Firmware/2019-07-01/openwrt-lantiq-xrx200-avm_fritz3370-rev2-hynix-squashfs-eva-kernel.bin mtd1
put /home/lubuntu/FRITZ/Firmware/2019-07-01/openwrt-lantiq-xrx200-avm_fritz3370-rev2-hynix-squashfs-eva-filesystem.bin mtd0
(As you can see easily guess my 3370 works with a Hynix NAND device
As soon as the terminal with the ftp client program started I copied and pasted. After successfully "putting" openwrt to my box I issued
quote REBOOT
and waited for some minutes to let the 3370 do whatever it had to do. This is the recording of my session:
Connected to 192.168.178.1.
220 ADAM2 FTP Server ready
331 Password required for adam2
230 User adam2 successfully logged in
binary
200 Type set to BINARY
passive
Passive mode on.
debug
Debugging on (debug=1).
---> SYST
215 AVM EVA Version 1.1186 0x0 0x741D
Remote system type is AVM.
ftp> quote SETENV linux_fs_start 0
---> SETENV linux_fs_start 0
200 SETENV command successful
ftp> quote MEDIA FLSH
---> MEDIA FLSH
200 Media set to MEDIA_FLASH
ftp> put /home/lubuntu/FRITZ/Firmware/2019-07-01/openwrt-lantiq-xrx200-avm_fritz3370-rev2-hynix-squashfs-eva-kernel.bin mtd1
local: /home/lubuntu/FRITZ/Firmware/2019-07-01/openwrt-lantiq-xrx200-avm_fritz3370-rev2-hynix-squashfs-eva-kernel.bin remote: mtd1
ftp: setsockopt (ignored): Permission denied
---> PASV
227 Entering Passive Mode (192,168,178,1,12,9)
---> STOR mtd1
150 Opening BINARY data connection
226 Transfer complete
2222410 bytes sent in 1.46 secs (1.4519 MB/s)
ftp> put /home/lubuntu/FRITZ/Firmware/2019-07-01/openwrt-lantiq-xrx200-avm_fritz3370-rev2-hynix-squashfs-eva-filesystem.bin mtd0
local: /home/lubuntu/FRITZ/Firmware/2019-07-01/openwrt-lantiq-xrx200-avm_fritz3370-rev2-hynix-squashfs-eva-filesystem.bin remote: mtd0
ftp: setsockopt (ignored): Permission denied
---> PASV
227 Entering Passive Mode (192,168,178,1,12,7)
---> STOR mtd0
150 Opening BINARY data connection
226 Transfer complete
4063232 bytes sent in 2.87 secs (1.3485 MB/s)
ftp> quote REBOOT
---> REBOOT
221 Thank you for using the FTP service on ADAM2
ftp>
After I while (5 minutes?) I switched the power off and on again, connected to the serial console and was rewarded with
BusyBox v1.31.0 () built-in shell (ash)
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
OpenWrt SNAPSHOT, r10368-17ae3eb9ff
-----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:/# passwd
Sincerely
Johann
******************* LINKS ****
https://openwrt.org/toh/avm/fritz.box.wlan.3370
https://www.bachmann-lan.de/openwrt-auf-einer-avm-fritzbox-3370-installieren