Banana Pi R64 The best router for OpenWrt, or not?

image

Hello my name is Dmitry and today I will review the Banana Pi R64 single-board computer. We will learn how to install OpenWrt on it and how to assemble the firmware for this computer itself.

So, on Habré there is already an overview on this computer here it is, but there the author uses Armbian as the OS. I tried this OS, as well as Debian, and came to the conclusion that there is no better OS for creating a router than OpenWrt, here are the reasons:

  1. On OpenWrt, the network is configured automatically without any involvement on your part. On Debian and Armbian, you need to configure the network yourself, through the configuration files.
  2. The OpenWrt web interface is designed for router management. Debian and Armbian also have web interfaces (Webmin, etc.), but they are designed for general server management.
  3. Of the advantages of Debian and Armbian, a simpler file system can be noted, which is displayed as is. OpenWrt has a very complex file system. Consisting of several mount points, some of which have a read-only attribute.

How to install openwrt


This manual is taken from the official Banana PI forum: forum.banana-pi.org/c/Banana-Pi-BPI-R2 .

To install OpenWrt you will need:

  1. Micro sd card
  2. Enternet Cable
  3. Usb-uart adapter
  4. Win32 diskimager
  5. TFTP server
  6. Putty
  7. Sd image for card
  8. Img image that you upload to the device’s internal memory
  9. The preloader needed to download this image

Procedure:

  1. Fill the sd image onto the sd card using Win32 Diskimager
  2. Connect the Usb-Uart adapter to the corresponding contacts on the board (tx router - rx converter, rx router - tx converter, connect the ground), go into Putty and connect to the Com port, the data transfer speed is 115200. You can see which Com port you need in Device Manager is usually COM4.
  3. Insert the card into Banana PI and turn it on.
  4. In the U-boot menu, select 'b. System Load flashimage then write to Flash via TFTP '(TFTP server must be enabled. The image file must be placed in the same folder as the TFTP server. In the network card settings, you must specify the IP address and the Main gateway).
  5. After the firmware, we return to the U-Boot menu with the bootmenu command and the '7 option. System Load Preloader then write to Flash via TFTP 'fill in the preloader (This file should also be in the folder with the TFTP server).
  6. We reboot the router and see OpenWrt. U-boot menu is now available without an SD card, now it will always appear for 3 seconds at boot.

Unfortunately, the image that we uploaded to the device is very old. Therefore, for example, you cannot install additional applications (packages) on it.

Where to get OpenWrt?


I must say that at the time of this writing there is no stable version of OpenWrt for Bpi-R64. There is support for this device in the development branch , but at the moment the compatibility is not complete. That is, you can load the initramfs image and it will work. But this image was created for familiarization with OpenWrt, it exists only in the RAM and after rebooting the device, all settings and installed applications will be lost. The sysupgrade image is currently not working, and if you install it, the device will simply restart constantly.

Therefore, the only way to get a working sysupgrade image is to build it yourself using patches from the official Banana PI forum.

I have already assembled the OpenWrt image from April 16, 2020. This imageimage .

It includes:

  1. Transmission with web interface
  2. NTFS-3G driver details here
  3. Samba
  4. mc, nano, htop and other utilities

To install this image, go to the U-boot menu and select the option: 2) System Load Linux Kernel then write to Flash via TFTP.
But if you want to build your own image, then here's how to do it.

How to build a working OpenWrt image


Since the process of assembly and preparation for it is very voluminous, I will describe only the main points.

1) To build you need a virtual machine and a Linux image. How to prepare them and where to get them is described here . I want to note that in the settings of the virtual machine, be sure to specify the number of cores of your processor (by default it is 1). The kernel assembly process is very long, and on one core it will be even longer.

2) After that you need to download the source from Git how to do it is described here . It is necessary to stop at the make menuconfig command

3) Go to the openwrt / target / linux / mediatek / makefile file and change the kernel number from 5.4 to 4.19. It is currently not possible to build an OpenWrt image on the 5.4 kernel.

4) make menuconfig select Target-> Mediatck Arm, Subtarget-> mt7622, ​​Profile-> Banana Pi R64. You can also select the additional packages you need. Then we exit with conservation.

5) make defconfig I don’t know why, but they always do this command.

6) make kernel_menuconfig -j5 the number after j is calculated as the number of cores of your processor plus one (I have a four-core processor).

7) After half an hour of waiting, the kernel configuration menu appears here, you need to set these options:
“Device Drivers” -> “Memory Technology Device (MTD) support” -> “Command line partition table parsing”
“Device Drivers” - > "Memory Technology Device (MTD) support" "Self-contained MTD device drivers" -> "MTD using block device"
“Device Drivers” -> “MMC / SD / SDIO card suport” -> “MMC block device driver”

8) Take this patch and copy it here: openwrt / target / linux / mediatek / patches-4.19. (I want to note that this patch constantly caused compilation errors. Therefore, I just copied the lines from it to the mt7622-bananapi-bpi-r64.dts file which lies here: openwrt / linux / mediatek / files-4.19 / arch / arm64 / boot / dts / mediatek)

9) make -j5

10) After compilation, the openwrt-mediatek-mt7622-bpi_bananapi-r64-squashfs-sysupgrade.bin file that you can flash via the u-boot menu option will be in the bin folder: 2) System Load Linux Kernel then write to Flash via TFTP.

Conclusion


Banana Pi is a very controversial device. High performance is combined with ugly support from developers. There is no official firmware, but support from third-party developers is so-so. But still it is a very powerful router with 5 gigabit ports, a gigabyte of RAM, and a fast dual-core processor. That is, there is no such thing as on an ordinary router, when you put Transsmison to download and the router puffs and creaks as if it were going to die. Here, the operation of Transmission does not affect the responsiveness of the device.

It is also worth noting that the device is sold without a case. Therefore, the body will have to do it yourself. But if you have a 3D printer then this is not a problem here is my version

PS Updated firmware added Quality of Service

05/07/2020 Once again updated the firmware, added ntfs-3g-low a faster implementation of ntfs.

PPS My small observations: OpenWrt on reboot generates a new MAC address for the device. And for example, my modem that is connected to the router, I also need to reboot if the router was rebooted, and Windows finds a new network (which is not critical but annoying). All this is solved by setting a constant MAC address for both wan and lan.

Files


  1. My firmware build
  2. Settings for menu config from my build
  3. Case for Banana Pi R64 on thingiverse

All Articles