BPI-R2 new image: OpenWrt 18.06.2 source code fork

TL/DR version is: you don’t. Use external AP with vendor-provided firmware to get stable and performant WiFi.

Long version: In general decoupling things like central network mini-servers/routers and disposable infrastructure elements like WiFi APs is a good idea. WiFi protocols get updated and WiFi security gets patched at a way faster pace compared to the speed upgrades we get at wired networking space. R2 is performant enough to be able to satisfy my routing and home server needs for approx 5-6 next years. On the other hand I had updated my 802.11n AP to 802.11ac AP in the end of last year and it is already sort-of obsolete as WiFi 6 (802.11ax) is on its way to public.

But even leaving this aside the built-in WiFi chip in R2 is known to be “brittle/tricky”: there are no upstream linux drivers for it, vendor-shipped drivers are buggy, AP setup process is non-standard, e.t.c. So better bet would be to get a mini-PCIEx WiFi module with a WiFI chipset that is known to be well-supported under linux and try your luck with it. I’ve seen reports on other forums of people having good results with external WiFi mini-PCIEx modules under Armbian. Try checking Armbian download/FAQ page for BPi R2 for more info.

Hi for compiling I was using the steps highlighted in the first post of this thread.

That trace appeared after I was doing some online speed tests (not iperf3) from a PC connected behind the BPI-R2 box.

What are the exact steps to check the commit sha ?

Thanks @LeXa2 and @frank-w for your feedback. :slight_smile:

So for the beginning I try to get the wired part working.

First of all thanks @LeXa2 for forking this!

I have been trying myself to no avail. Can you please share the exact steps you did? I am not sure what do with what image and using dd to write the images to mmcblk1 is not working (I am on the R2 running ubuntu right now typing this).

Thanks in advance!

Ubuntu/debian images have swapped mmc (kernel) due to compatibilty with official kernel.

Here sd-card is mmcblk0 and emmc is mmcblk1

Openwrt uses vanilla-kernel without mmc-swap

Best option should be looking for mmcblkXboot0 to determine X

cat /proc/partitions

Don’t forget flashing preloader to boot0

Btw. @bialy39 bootargs are included in uboot (not preloader) also kernelname to load.

If you do not need to change it you don’t need a uenv.txt

Thanks frank, I actually already noticed this, I tried to flash on mmcblk1 as I noticed this was the only empty one, so this had to be the EMMC.

This is where I got a problem… I found in this link below the images, so I tried mtk-bpi-r2-preloader-emmc.bin

I also tried to dd this image:

I created a fat16 partition of 256 MB to flash the preloader (mmcblk1p1) Then an ext4 partition of the rest of the storage to flash the image (mmcblk1p2)

Here are the commands I tried:

echo 0 > /sys/block/mmcblk1boot0/force_ro
dd if=mtk-bpi-r2-EMMC.img of=/dev/mmcblk1boot0 bs=1M count=1

It didn’t seem to do anything and I guess there was a problem with the partitioning So I made my own partitions and tried this:

dd if=mtk-bpi-r2-preloader-emmc.bin of=/dev/mmcblk1
dd if=mtk-bpi-r2-EMMC.img of=/dev/mmcblk1p2

But I guess I am still doing something wrong… Hence my question on the exact images I need to use, and the exact commands I need to try :slight_smile: Thanks!

Drop count in your dd-command and do not write to partition (p2)…only mmcblkXboot0 (preloader) and mmcblkX (os-image)

echo 0 > /sys/block/mmcblk1boot0/force_ro
dd if=mtk-bpi-r2-preloader-emmc.bin of=/dev/mmcblk1boot0
dd if=mtk-bpi-r2-EMMC.img of=/dev/mmcblk1

Have you partitioning the emmc? Maybe it’s the PARTITIONCONFIG=0 problem…

Try to write partitionconfig like it’s written in my wiki. Also you may need to change ubootconfig

You have debug-uart working? Just to see if uboot comes up without sdcard and hang anywhere else

Like this:

# git describe
# git rev-parse HEAD

To reiterate, am I correct that your traffic flow was like below at the moment of network stall?

[Client PC] <-> [R2 lanX port](NAT egres)[R2 wan port] <-> {Internet} <-> [Remote Host]

I’m getting a bit lost here - where did you get a file named like this? There’s no such file produced when compiling OpenWRT from the fork this thread is about.

Thanks again frank I will try this (I don’t have it at home right now)

This may be my problem, I used gparted to create a partition table and then one fat16 partition for boot, one ext4 for the openwrt image… but those are p1 and p2, not sure how i can manage to create a “boot0” partition… What would be the command?

I don’t have any external hardware to test it, if this is what you refer to.

You are right, it is 18.06.4 from another thread… I tried to compile both other images and your code, using the official ubuntu on the R2 itself (on sd card) but both failed, so I figured I might as well try compiled images… If you have one for your fork I would love to try it!

Boot0 can be created with uboot (debug-uart needed to see and enter uboot-prompt) or mmc-utils (from running linux like your ubuntu).


You’ll find compiled mmc-utils in 4.14 branch on my github-repo (utils/mmc/mmc)

Debug-uart is recommended…without it you cannot see if board hang anywhere


Yes you are correct. I had a PC connected to one of the LAN ports (in bridge mode) when I did the speed tests and the network stall occured.

Can you find a way to reproduce it (config,hw-wiring,etc)?

I will try tomorrow to redo the steps and see if I can reproduce it again.

I just check the commit sha for your OpenWRT branch and I see these results:

$ git describe
$ git rev-parse HEAD

I’m not sure if these are the expected results as I see that they are different than what you provided. Or are those only some examples and not the real ones ?

I also looked into the git repository folder target/linux/mediatek/patches-4.14 and I did not see the file:


I just ran recently some speedtests and iperf and so far everything works fine (trace error did not appear).

1 Like

Mine were examples - I just executed command on whatever local git working copy I’ve had at that moment. Yours are an exact match with the expected values. As you’re reporting that you are not able to reproduce the problem lately I’m wondering are you still on the same image you were when been affected by the problem? If that’s the case then it seems that this problem might be triggered by something else in addition to the 0027-net-next-mediatek-fix-DQL-support.patch. For me I had never experienced it since the moment I dropped out this patch for good. But it does not mean that the kernel is bug-free - it might be that the problem is rare with 0027-net-next-mediatek-fix-DQL-support.patch dropped out and I’m being lucky not to hit it (yet).

Hey, Thanks for such a lovely work and support for the R2.

I think you should update the checkout to the stable one as this is depreciated from your branch.

git checkout v18.06.2-bpir2-rc1, I used git checkout openwrt-18.06-bpir2

and in make menuconfig > I didnt change anything from this, except checked if its ext4 as mentioned.

Change this for normal users. make -j16 to make -j(processor cores)

I had some missing dependencies and it was just shown as warning and it started to compile. Waiting for it to finish compiling then will update how successful it is.

make -j4
WARNING: Makefile 'package/utils/busybox/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/busybox/Makefile' has a build dependency on 'libpam', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a dependency on 'libgnutls', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a dependency on 'libopenldap', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a dependency on 'libidn2', which does not exist
WARNING: Makefile 'package/network/utils/curl/Makefile' has a dependency on 'libssh2', which does not exist
WARNING: Makefile 'package/boot/kexec-tools/Makefile' has a dependency on 'liblzma', which does not exist
WARNING: Makefile 'package/network/services/lldpd/Makefile' has a dependency on 'libnetsnmp', which does not exist
time: target/linux/prereq#0.09#0.01#0.11

Should I install all the dependencies and then start again or let it continue? and how long does it normally take this to compile?


`make -r world: build failed. Please re-run make with -j1 V=s or V=sc for a higher v
erbosity level to see what's going on
make: *** [/home/furkan/Downloads/Projects/BPI/R2/openwrt/openwrt/include/toplevel.m
k:218: world] Error 1

Trying V=s now.

It’s not about you missing some deps on the build box, it is about mishaps/errors/misconfigs inside official upstream package feed. Some packages optionally may use some other packages (like curl may be compiled with libssh2 support, e.t.c.) but these other packages are not enabled by default and thus are not found. For the most part warnings like these are safe to ignore.

i guess you mean libbssl :wink:

@spikerguy you can do this to fix the warnings: BPI-R2 new image: OpenWrt 18.06.2 source code fork