Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
projects:fritz3490 [2020/05/26 12:34] Andreas Böhlerprojects:fritz3490 [2020/05/28 08:53] (current) Andreas Böhler
Line 3: Line 3:
 ====== Linux/OpenWrt on the AVM FRITZ!Box 3490 ====== ====== Linux/OpenWrt on the AVM FRITZ!Box 3490 ======
  
-After working on the 3390, I bought a used 3490 which is more capable (twice the RAM, Flash and more WiFi bandwidth). Currently, I'm experiencing problem with the xhci controller, but apart from that, it's working fine. +After working on the 3390, I bought a used 3490 which is more capable (twice the RAM, Flash and more WiFi bandwidth). Currently, I'm experiencing problems with the xhci controller, but apart from that, it's working fine. 
  
 The approach is similar to the 3390: You get a VDSL router/modem (Lantiq target) and a separate WiFi access point (ath79 target) on one PCB. The approach is similar to the 3390: You get a VDSL router/modem (Lantiq target) and a separate WiFi access point (ath79 target) on one PCB.
Line 58: Line 58:
  
 <code> <code>
-scp -o UserKnownHostsFiles=/dev/null bin/targets/lantiq/xrx200/openwrt-lantiq-xrx200-avm_fritz3490-sysupgrade.bin root@192.168.1.1:/tmp+scp -o UserKnownHostsFiles=/dev/null bin/targets/lantiq/xrx200/openwrt-lantiq-xrx200-avm_fritz3490-squashfs-sysupgrade.bin root@192.168.1.1:/tmp
 </code> </code>
  
Line 66: Line 66:
 ssh -o UserKnownHostsFile=dev/null root@192.168.1.1 ssh -o UserKnownHostsFile=dev/null root@192.168.1.1
 # ....once connection is established, run on the OpenWrt device: # ....once connection is established, run on the OpenWrt device:
-sysupgrade /tmp/openwrt-lantiq-xrx200-avm_fritz3490-sysupgrade.bin+sysupgrade /tmp/openwrt-lantiq-xrx200-avm_fritz3490-squashfs-sysupgrade.bin
 </code> </code>
  
 Your router should reboot and OpenWrt for the Lantiq target is successfully installed. Your router should reboot and OpenWrt for the Lantiq target is successfully installed.
 +
 +==== ath79 target ====
 +
 +For the WiFi part, you need a separate OpenWrt installation that is booted from RAM. We need one file from an original AVM firmware in order to be able to boot the second instance (the stage 1 firmware). The stage 2 firmware is replaced by OpenWrt.
 +
 +Run the following to extract it from an OEM firmware and transfer it to your box:
 +
 +NOTE: unsquashfs4-avm-be is part of http://freetz.org/. You have to checkout the freetz source and build the tools (make tools) to get the binary. NOTE: p7zip version 15.09 or newer is required to extract the images. 
 +
 +<code>
 +wget https://download.avm.de/fritzbox/fritzbox-3490/deutschland/fritz.os/FRITZ.Box_3490-07.12.image
 +7z e FRITZ.Box_3490-07.12.image -r filesystem.image
 +7z e filesystem.image filesystem_core.squashfs
 +unsquashfs4-avm-be filesystem_core.squashfs -e lib/firmware/ath_tgt_fw1.fw
 +scp squashfs-root/lib/firmware/ath_tgt_fw1.fw root@192.168.1.1:/opt/wasp
 +</code>
 +
 +Assuming you have already built the Lantiq target, you need to prepare a second OpenWrt build:
 +
 +Prepare the sources, switch to the required branch and fetch the package feeds:
 +<code>
 +git clone https://github.com/andyboeh/openwrt openwrt_ath79
 +cd openwrt_ath79
 +git checkout avm_fritz3490_wasp
 +./scripts/feeds update -a
 +./scripts/feeds install -a
 +</code>
 +
 +Then, you can configure the build using ''%%make menuconfig%%''. Select "ath79" and "AVM FRITZ!Box 3490 WASP" as target. Do not touch any other configuration options. Then, compile with the following (replace ''%%-j5%%'' by the number of cores you have +1, so ''%%-j5%%'' is for my quad-core system).
 +
 +<code>
 +make defconfig
 +make -j5
 +</code>
 +
 +If everything goes fine, you can transfer the resulting build to the FRITZ!Box:
 +
 +<code>
 +scp bin/targets/ath79/openwrt-ath79-generic-avm_fritz3490_wasp-initramfs-kernel.bin root@192.168.1.1:/opt/wasp
 +</code>
 +
 +Then, connect to your FRITZ!Box via SSH and start the WiFi system:
 +
 +<code>
 +ssh root@192.168.1.1
 +# ....once connection is established, run on the OpenWrt device:
 +/opt/wasp/upload-wasp.sh
 +</code>
 +
 +If the script succeeds, you have another OpenWrt instance ready at ''%%192.168.1.2%%''. This is a separate instance with access to the WiFi modules but no persistent storage, thus configuration within this target is not persistent. To overcome this limitation, the Lantiq stores the configuration files in ''%%/opt/wasp/files%%''. The WiFi configuration is thus in ''%%/opt/wasp/files/etc/config/wireless%%'', the network in ''%%/opt/wasp/files/etc/config/network%%''. If you change any configuration file, you need to delete the file ''%%/opt/wasp/config.tar.gz%%'' and re-run ''%%/opt/wasp/upload-wasp.sh%%''.
 +
 +The file ''%%/opt/wasp/config.tar.gz%%'' serves as an overlay that is extracted on the ath79 target to the root filesystem (-> configuration files). Additionally, it contains a script ''%%/opt/wasp/files/usr/bin/wasp_script%%'' that is executed during the ath79 boot. By default, it disables the DHCP server on the ath79 target which makes no sense.
 +
 +By default, the ath79 target uses a static IP address of 192.168.1.2, it can be changed in ''%%/opt/wasp/files/etc/config/network%%''.
 +
 +Upon first start of ''%%/opt/wasp/upload-wasp.sh%%'' all configuration files are created! I suggest to start with the default configuration for the first time and then continue with configuring the device.
 +
 +If you want to install additional packages on the ath79 target, you need to place all its files on the lantiq target into ''%%/opt/wasp/files%%'' and re-create the config.tar.gz file - as it will be extracted to the root folder without further checks, it can contain binaries as well.
 +
 +Technically, the ath79 target has a boot hook that waits for the upload of the file ''%%config.tar.gz%%'' by the stage 2 firmware upload.
 +
 +If you want to bring up WiFi on boot, you can add the script to the auto start file:
 +
 +<code>
 +ssh root@192.168.1.1
 +# ....once connection is established, run on the OpenWrt device:
 +echo '/opt/wasp/upload-wasp.sh' >> /etc/rc.local
 +</code>
 +