Apologies for posting this after so many months.
The flash process does not work with circa 2014 versions of NetBSD tnftp.
But it DOES work with:
FTP Linux NetKit (0.17)
This try was successful.
A laptop running Ubuntu is directly connected to Lan1 on the Fritz!Box.
I connected the power supply to the fritz!box and quickly started the ftp session.
I tried both typing in the ftp instructions one by one and piping them in, and both methods worked.
In the previous try it was interesting that the NetBSD ftp session made it so far and then ultimately failed at the file transfer. This is worthy of future study
Model
Fritz!Box Box 4040
2000 2763
Version of Fritz OS
FRITZ.Box_4040-07.12.image
Macbook Operating System
cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.3 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.3 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
Laptop ftp version
man ftp
0.17-34
Linux NetKit (0.17) August 15, 1999 Linux NetKit (0.17)
Commands that we ran
##so we can use ifconfig
apt install net-tools
##Get the OpenWRT copy
wget http://downloads.openwrt.org/releases/18.06.4/targets/ipq40xx/generic/openwrt-18.06.4-ipq40xx-avm_fritzbox-4040-squashfs-eva.bin
##Working Directory /root/20191026TryToInstallOpenWRTOnFritzBox
contents of 20191026SetupEth0ForFritzBox.sh
ifconfig enp0s10 up
ifconfig enp0s10 192.168.178.2
ifconfig enp0s10 netmask 255.255.255.0
ifconfig enp0s10 broadcast 192.168.178.254
ifconfig enp0s10
contents of commandsToSendToFTP.txt
debug on
status
system
quote SETENV linux_fs_start 0
quote MEDIA FLSH
binary
passive on
quote PASV
epsv4 off
epsv6 off
sendport off
status
put openwrt-18.06.4-ipq40xx-avm_fritzbox-4040-squashfs-eva.bin mtd1
Configure the Network AND Send The Flash Via FTP!
./20191026SetupEth0ForFritzBox.sh
(cat 20191026commandsToSendToFTP.txt | ftp -n -v -p -d -4 -t ) &> `date +%Y-%m-%d_%H%M`FTPFritzBox4040OpenWRTLog.txt &
Output from the ftp session 20190901_1148FTPFritzBox4040OpenWRTLog.txt
isipv6addr: got 0 for ftp://adam2:adam2@192.168.178.1
fetch_ftp: `ftp://adam2:adam2@192.168.178.1'
parse_url: URL `ftp://adam2:adam2@192.168.178.1'
parse_url: user `adam2' pass `adam2' host 192.168.178.1 port ftp(21) path `'
fetch_ftp: user `adam2' pass `adam2' host 192.168.178.1 port ftp path `' dir `<null>' file `<null>'
setupsockbufsize: rcvbuf_size determined as 87380
setupsockbufsize: sndbuf_size determined as 16384
Connected to 192.168.178.1.
220 ADAM2 FTP Server ready
ftp_login: user `adam2' pass `adam2' host `192.168.178.1'
---> USER adam2
331 Password required for adam2
---> PASS XXXX
230 User adam2 successfully logged in
---> SYST
215 AVM EVA Version 1.3243 0x0 0x240D
Remote system type is AVM.
---> FEAT
502 Command not implemented
features[FEAT_FEAT] = 0
features[FEAT_MDTM] = -1
features[FEAT_MLST] = -1
features[FEAT_REST_STREAM] = -1
features[FEAT_SIZE] = -1
features[FEAT_TVFS] = -1
updatelocalcwd: got `/home/pjones/Documents/2019Spring/20190830FritzBox4040OpenWRT'
---> PWD
502 Command not implemented
---> TYPE I
200 Type set to BINARY
Debugging on (ftp_debug=1).
Connected and logged into 192.168.178.1.
No proxy connection.
Gate ftp: off, server (none), port ftpgate.
Passive mode: on; fallback to active mode: off.
Mode: stream; Type: binary; Form: non-print; Structure: file.
Verbose: on; Bell: off; Prompting: on; Globbing: on.
Store unique: off; Receive unique: off.
Preserve modification times: on.
Case: off; CR stripping: on.
Ntrans: off.
Nmap: off.
Hash mark printing: off; Mark count: 1024; Progress bar: on.
Get transfer rate throttle: off; maximum: 0; increment 1024.
Put transfer rate throttle: off; maximum: 0; increment 1024.
Socket buffer sizes: send 16384, receive 87380.
Use of PORT cmds: on.
Use of EPSV/EPRT cmds for IPv4: on.
Use of EPSV/EPRT cmds for IPv6: on.
Command line editing: off.
Version: tnftp 20141104
---> SYST
215 AVM EVA Version 1.3243 0x0 0x240D
---> SETENV linux_fs_start 0
200 SETENV command successful
---> MEDIA FLSH
200 Media set to MEDIA_FLASH
---> TYPE I
200 Type set to BINARY
Passive mode: on; fallback to active mode: off.
---> PASV
227 Entering Passive Mode (192,168,178,1,12,0)
EPSV/EPRT on IPv4 off.
EPSV/EPRT on IPv6 off.
Use of PORT/LPRT cmds off.
Connected and logged into 192.168.178.1.
No proxy connection.
Gate ftp: off, server (none), port ftpgate.
Passive mode: on; fallback to active mode: off.
Mode: stream; Type: binary; Form: non-print; Structure: file.
Verbose: on; Bell: off; Prompting: on; Globbing: on.
Store unique: off; Receive unique: off.
Preserve modification times: on.
Case: off; CR stripping: on.
Ntrans: off.
Nmap: off.
Hash mark printing: off; Mark count: 1024; Progress bar: on.
Get transfer rate throttle: off; maximum: 0; increment 1024.
Put transfer rate throttle: off; maximum: 0; increment 1024.
Socket buffer sizes: send 16384, receive 87380.
Use of PORT cmds: off.
Use of EPSV/EPRT cmds for IPv4: off.
Use of EPSV/EPRT cmds for IPv6: off.
Command line editing: off.
Version: tnftp 20141104
local: openwrt-18.06.4-ipq40xx-avm_fritzbox-4040-squashfs-eva.bin remote: mtd1
---> PASV
227 Entering Passive Mode (192,168,178,1,12,0)
---> STOR mtd1
421 Service not available, remote server timed out. Connection closed.