Banana Pi BPI-R4: OpenWrt Quickstart

7 min read Original article ↗

When Banana Pi sent over a BPI-R4, I said, ‘NEAT!’ and tossed it in the corner. Hey, it’s a development board with developer documentation – didn’t want to tango with it. This went on for about four weeks until curiosity got the best of me. Let’s be honest, an ARM SBC with dual 10-gig fiber? Too tempting!

An afternoon of following the official docs ended with a block of soft-bricked eMMC. Day two was that fun game of reading through dozens of Reddit posts and digging through the official forums. However, that resulted in a BPI-R4 booting OpenWrt from eMMc!

Now, I don’t want to deprive anyone of that learning experience, but I know it can be a big ole ball of nope if you’re new to single-board computers.

So I hammered out this quick-start guide to help you get up and running with OpenWrt.


IN THE BOXES

The Banana Pi BPI-R4 packs a quad-core ARM A73 processor, 4GB of RAM, dual 10GbE fibre ports, four 1GbE Ethernet ports, Wi-Fi 7 connectivity, 8GB of internal storage, an NVMe slot, and USB 3.0 support.

All of this comes in the form of two delightfully blue PCBs.

WI-FI 7 NIC front
WI-FI 7 NIC rear
Banana Pi BPI-R4 rear
Banana Pi BPI-R4 front

WI-FI 7 NIC

The Wi-Fi 7 module pops in like a double-barreled NVMe drive. Tighten down the screw, click on a couple of antennas, apply thermal squares, and remember to flip the Wi-Fi switch.

WI-FI 7 NIC slot insertion
WI-FI 7 NIC screws
WI-FI 7 NIC antenna connectors
WI-FI 7 NIC thermal pads
WI-FI 7 NIC switch position

POWER USAGE

The BPI-R4 pulls a little over 9 watts from the mains at idle, but keep in mind this is with the Wi-Fi 7 module, NVMe drive, and active cooling.

BPI-R4 power usage

INSTALLING FROM SD CARD

If you don’t mind running OpenWrt on an SD card things are pretty simple. Head over to the OpenWrt firmware selector and download the latest snapshot, write the image to an SD card, place both switches in the down position and pop it in.

OpenWrt firmware selector
Burning SD image
SD switch position

Plug in some internet and ssh into the BPI-R4.

ssh root@192.168.88.1

Update the package list.

apk update

Grab a couple of basic packages.

apk add block-mount e2fsprogs kmod-usb-storage-uas kmod-usb3 luci kmod-fs-ext4 kmod-nvme

And reboot the BPI-R4.

reboot 

Point your browser at http://192.168.1.1, log in, and immediately set your root password.

OpenWrt web interface

That’s pretty much that. The BPI-R4 should be ready to tinker with.

OpenWrt status
OpenWrt Wi-Fi status

INSTALLING TO EMMC

Grab a USB to TTL UART converter thingy, connect RX to TX, and ground to ground.

USB to TTL converter

Crack open a copy of minicom and point your USB to TTL UART converter thingy at the correct port.

sudo minicom -s
Minicom
Minicom port setup

Head over to the OpenWrt firmware selector and download the latest snapshot, write the image to an SD card, place both switches in the down position, pop it in, and power up the BPI-R4.

You will be greeted by your new BFF, U-Boot! Select option seven and tap ENTER.

U-Boot

After a few seconds you will be greeted with this screen. Press ENTER and power down the BPI-R4.

OpenWrt NAND install

Slam switch to the up position and reapply the electrons.

NAND boot switch position

This time your BFF will have an option to install to eMMc. Go for it!

U-Boot eMMc install

Another chunk of text will fly by and once again, it’s time to press ENTER and power down the BPI-R4.

U-Boot eMMc install

Now put switch in the down position and flip switch #2 up.

eMMc boot switch position

Power on the BPI-R4 and confirm that it booted from eMMc.

eMMc boot

That’s it, you’re good to go.


NVME STORAGE

I don’t know if it’s the roundabout way of installing to eMMC or some other delightful quirk, but at the end of the day, you end up with a whopping 400 MiB of available storage. If you’re running OpenWrt and nothing else, well, that’s plenty, but I’m guessing you didn’t buy a BPI-R4 just to run OpenWrt, and you’re going to need a wee bit more storage.

OpenWrt storage

<blink>WARNING: There’s probably a correct way to go about this that doesn’t wipe your settings, this is the opposite of that. Backup before proceeding.</blink>

Step one is tossing something into the NVMe hole. I went with a 250 GB Samsung 960 EVO formatted with ext4.

NVMe drive installation

NOTE: If you format your drive with a filesystem other than ext4, you will need to install the corresponding kmod-fs package.

Package NameDescription
kmod-fs-autofs4Kernel module for AutoFS4 support
kmod-fs-btrfsKernel module for BTRFS support
kmod-fs-cifsKernel module for CIFS support
kmod-fs-configfsKernel module for configfs support
kmod-fs-cramfsKernel module for cramfs support
kmod-fs-exportfsKernel module for exportfs. Needed for some other modules.
kmod-fs-ext4Kernel module for EXT4 filesystem support
kmod-fs-f2fsKernel module for F2FS filesystem support
kmod-fs-fscacheGeneral filesystem local cache manager
kmod-fs-hfsKernel module for HFS filesystem support
kmod-fs-hfsplusKernel module for HFS+ filesystem support
kmod-fs-isofsKernel module for ISO9660 filesystem support
kmod-fs-jfsKernel module for JFS support
kmod-fs-minixKernel module for Minix filesystem support
kmod-fs-msdosKernel module for MSDOS filesystem support
kmod-fs-nfsKernel module for NFS client support
kmod-fs-nfs-commonCommon NFS filesystem modules
kmod-fs-nfs-common-rpcsecKernel modules for NFS Secure RPC
kmod-fs-nfs-v3Kernel module for NFS v3 client support
kmod-fs-nfs-v4Kernel module for NFS v4 support
kmod-fs-nfsdKernel module for NFS kernel server support
kmod-fs-ntfsKernel module for NTFS filesystem support
kmod-fs-reiserfsKernel module for ReiserFS support
kmod-fs-squashfsKernel module for SquashFS 4.0 support
kmod-fs-udfKernel module for UDF filesystem support
kmod-fs-vfatKernel module for VFAT filesystem support
kmod-fs-xfsKernel module for XFS support

Under mount points click add, select your NVMe drive, pick external overlay for the mount point and click save followed by Save and Apply.

OpenWrt mount points
Drive selection
Drive mount point

Man, I hope you didn’t skip over the BIG RED TEXT at the beginning of this section because you just lobotomized your router.

OpenWrt login

Time to ssh into the BPI-R4.

ssh root@192.168.88.1

Update the package list.

apk update

Grab a couple of packages.

apk add block-mount e2fsprogs kmod-usb-storage-uas kmod-usb3 luci kmod-fs-ext4 kmod-nvme

And reboot the BPI-R4.

reboot 

Look at all those available databits!

OpenWrt storage with NVMe drive

If you backed up your OpenWrt settings before performing this invasive bit of surgery, you can now safely restore them.


BENCHMARKS

According to Geekbench, the BPI-R4 is in a slap fight with the Raspberry Pi 4 in both single and multithreaded workloads.

That means there shouldn’t be any problems slinging databits over the SFP+ ports, and we’re seeing around 9.4 Gbits/s when using iperf3.

iperf3 speed test

TRANSCEIVER COMPATIBILITY

Transceivers come in three flavours. Fibre, copper, and ethernet with extra steps. I tested the following with the BPI-R4.

Everything JustWorked™ if you don’t count having to manually set the link speed on the 10Gtek 2.5GBase-T to RJ45 transceiver.

Fibre and DAC transceivers

SPECS

CPUMediaTek MT7988A (Filogic 880) Quad-core Arm Corex-A73,1.8GHz processor
SDRAM4 GB DDR4
On board StorageMicroSD (TF) card,128MB SPI NAND, 8GB eMMC
GPIO26 Pin GPIO,some of which can be used for specific functions including UART, I2C, SPI, PWM, I2S.
On board Network4 Port 10/100/1000Mbps Ethernet
SFP2x10G SFP+
mini PCIE2x miniPCIe slots with PCIe3.0 2lane interface for BPI Wi-Fi 7 NIC (Network Interface Card)
M.2 interface1x M.2 KEY-B slot with USB3.2/PCIe3.0 interface for 5G,1x M.2 KEY-M slot with PCIe3.0 1lane interface for NVME SSD
USB1xUSB 3.2 slot
ButtonsReset button,WPS botton, boot switch
LEDsPower status Led and RJ45 Led
Power12V/5.2A or 19V 3.2A(The power consumption will not exceed 10W without any peripheral equipment, and 12V/2A can be used.)
Size100.5x148mm same as Banana Pi BPI-R64 and Banana Pi BPI-R2

VERDICT

One of the neat bits of operating a studio is the opportunity to test hardware and software in production. For six days, I replaced the MikroTik RB4011, which previously powered the studio, with the BPI-R4. Throughout this period, the BPI-R4 managed the network traffic generated by my 8-port fiber switch, live streams, game servers, and the Jitsi box used for video conferencing.

I’m happy to report that everything worked.

And I’ve only scratched the surface. There are still tons of cool things to explore. Digging around in the forums genuinely reminds me of the early days of the Raspberry Pi with all the projects people are undertaking.

That said, if you’re just looking for some hardware to slap OpenWrt on, this ain’t it.

However, if you’re in the market for a device that can run OpenWrt, Ubuntu, or Debian, and packs the hardware needed to get up to all kinds of nonsense, the BPI-R4 brings the business.

Pros

Cons