A few days ago, I managed to flash OpenWrt on a FritzBox 7530, however I have to highlight that the official installation procedure (https://openwrt.org/toh/avm/avm_fritz_box_7530#installation) in the official table-of-hardware section is not clear for a non-expert user. Would be good to hear if this was intended to be written for experts.
I am glad I read this (Install OpenWrt on FritzBox 7530 (linux tftp) ) and this (OpenWrt 19.07.2 on FritzBox 7530 unable to bring up WiFi - #10 by Menion ) posts to tell that I could do the whole process with relatively simple steps in Windows rather than spending hours to re-invent the wheel in Linux (a process which finally never came to an end).
Some non-official OpenWrt guides that are suggested sporadically in the forum, talking about this (https://spur-records.de/amv-fritzbox-7530-flash/ ) and this (https://medium.com/@sabonchi/flash-openwrt-on-fritz-box-7530-20-ca13e01339f9 ), clearly demonstrate the use of Linux to get this process done. Under the official installation procedure, and especially if having read first the above guides, one initially and naturally thinks that the guide is written for Linux users as well, but it turns out that those steps apply to Windows users too! It does not tell you how though (i.e., what tools are required), so here is a clear(er) step-by-step installation guide (For Dummies) to flash OpenWrt to a FritzBox 7530 purely via Windows:
Instructions for Windows
- Download Python 3 from https://www.python.org/downloads/ (click download to the latest version and scroll down to Windows installers) and set it up by ticking both boxes during the setup. Reboot Windows. (Python 3 is a prerequisite to run the python script (eva_ramboot.py) as described later)
- Download PuTTY for Windows (https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html ). This is so that we SSH into the router at the final steps of the flashing process.
- Download the following 4 files:
i. openwrt-22.03.2-ipq40xx-generic-avm_fritzbox-7530-squashfs-sysupgrade.bin from https://downloads.openwrt.org/releases/22.03.2/targets/ipq40xx/generic/
ii. openwrt-22.03.2-ipq40xx-generic-avm_fritzbox-7530-initramfs-fit-uImage.itb from https://downloads.openwrt.org/releases/22.03.2/targets/ipq40xx/generic/ and rename it to FRITZ7530.bin
iii. uboot-fritz7530.bin from https://downloads.openwrt.org/releases/22.03.2/targets/ipq40xx/generic/u-boot-fritz7530/
iv. eva_ramboot.py from https://github.com/openwrt/openwrt/blob/master/scripts/flashing/eva_ramboot.py . You can create a new txt file on your desktop, copy-paste the text of the script from the aforementioned address and save it as eva_ramboot.py by omitting the .txt extension. (To do that easily go to Folder Options in Windows Explorer -> View-> untick “Hide extensions for known file types”, and then delete the txt extension)
- Download tftpd64 portable (or 32 if you are on 32-bit) from here (https://bitbucket.org/phjounin/tftpd64/downloads/ ) and extract the folder. This programme is going to be used to set up a tftp server which will act as an intermediary between our PC and the FritzBox and via this we will push files to the router.
- (OPTIONAL : DEPENDS ON THE RESULT OF A LATER STEP (17a) – Download WinSCP from here: https://winscp.net/download/WinSCP-5.21.6-Portable.zip , and extract the zip.)
- Place/Copy all 4 files as per step 3 above to the same directory in which the tftpd64.exe was extracted.
- Go to your computer ethernet adapter settings (via “networking and sharing centre” in the control panel of Windows, then “change adapter settings” on the left, then right click and Properties to your physical Ethernet adapter) and change your IPv4 address to Manual at 192.168.178.10 and subnet mask 255.255.255.0.
- Connect your computer via ethernet to one of the LAN ports of FritzBox. The Fritzbox should be powered-off until this stage.
“Neutralisation” and Flashing process
- Now that all prerequisites are in place, you can go to Start key, Run, cmd (run as administrator).
- Go to the desired directory (I assume that tftpd64.462 was placed in your Desktop) in the command prompt by using:
cd/ + Enter
cd users + Enter
cd YOURUSERNAME + Enter
cd Desktop + Enter
cd tftpd64.462 + Enter
- Plug the power to the FritzBox and wait until the Power led lights up three times.
- After the third lit up, copy-paste the following command in cmd and hit enter:
python eva_ramboot.py --offset 0x85000000 192.168.178.1 uboot-fritz7530.bin
- The U-Boot will now start. If all went well, you should see the following in your cmd screen:
SETENV memsize 0x00080000
200 SETENV command successful
SETENV kernel_args_tmp mtdram1=0x85000000,0x88000000
200 SETENV command successful
200 Media set to MEDIA_SDRAM
- Now you need to change again your IP address to 192.168.1.70 (in the same way as in step 7 above)
- Run the tftpd64.exe and open up your tftpd64 server tab (not client) and choose 192.168.1.70 from the dropdown menu.
- You should see the tftpd64 server screen “sucking” the FRITZ7530.bin file, meaning that the FritzBox pulled the initramfs image into RAM. This may take up to two minutes.
- Leave the tftpd64 on the side now, and push the remaining two files to the FritzBox, via the command prompt (cmd) this time, by typing the following commands and by hitting Enter:
- OPTIONAL (a). If suddenly the connection drops and the command prompt gives a message saying that someone may be doing “nasty” things etc and you are not allowed to proceed with the 2 scp commands above, then you can alternatively try using WinSCP to SSH into the router’s “/tmp/” directory and copy the two files manually there with right-click -> copy from the tftpd64.462 folder and paste them into the “tmp” directory. To connect to the router via SSH and look at the folder structure and do file transfers on a gui environemnt, open up WinSCP, choose SCP as protocol and enter 192.168.1.1 as host name and root as username. After the 2 files are transferred to the “tmp” folder, proceed to the next step.
- After both have been executed, or if you have proceeded with step 17a, run PuTTY now. You need to specify on the pop-up window, SSH as the connection type, 192.168.1.1 as the Host IP address and Port 22. Hit open and the SSH session will pop up asking you to input a username. Use “root”. On password prompt type the default OpenWrt password: “password”. You will not see the password populated while typing – this is normal. After this step you will have logged into the OpenWrt router via SSH connection.
- Type now the following commands and hit enter, to write the bootloader to both previous kernel partitions:
mtd write /tmp/uboot-fritz7530.bin uboot0
mtd write /tmp/uboot-fritz7530.bin uboot1
- Type the following commands and hit enter, to remove the AVM filesystem partitions to make room for our kernel + rootfs + overlayfs:
ubirmvol /dev/ubi0 --name=avm_filesys_0
ubirmvol /dev/ubi0 --name=avm_filesys_1
- Finally, enter the following command and hit enter to flash the OpenWrt image permanently:
sysupgrade -n /tmp/openwrt-22.03.2-ipq40xx-generic-avm_fritzbox-7530-squashfs-sysupgrade.bin
- At this point you will get a message in the SSH session saying:
Connection to 192.168.1.1 closed by remote host.
Connection to 192.168.1.1 closed.
This implies that the process is now complete.