OpenWrt support for NanoPi R2C

I'm using a NanoPi R2S without any problems so far.
Now I would like to use another one at my parents home and to connect them via wireguard. But the R2S is hard to get for little money, since it is replaced by the R2C

As I understood the only difference is that a MotorComm YT8521S Gigabit Ethernet transceiver is used (replacing the Realtek RTL8211E from the R2S)

So I'm wondering if its possible to get the R2C working with Openwrt, by just replacing the the lan driver module.

Henning

good news - it should work out of the box with r2s image but
bad news - no driver in openwrt for motorcomm YT8521S - you have to compile it
i only know of these sources https://github.com/cnxsoft/YT8521S/

Motorcom YT8511 support has been merged for v5.14, it's probably not too difficult to extend that work for YT8521S and then backport it for v5.10.

I think it will be very helpful if a developer can add support. I'm no developer and building the drivers is nearly impossible for noobs at this point. Too many knowledge is assumed.
And already the english docu is hard to understand for non native speakers....
I'm missing a ready to go developer environment as LXC container.

But I'm happy that I have found an R2S with passive cooled aluminium case at 50% discount for "only" 60€ at aliexpress. Just 10€ more exprensive than a R2C, but 100% more expensive than in january.
Hope it will be deliverd until christmas ...

I ordered an R2C to play around with. When it gets here in about a month, I'm willing to test drivers / builds / etc. It looks like the latest version of FriendlyWRT released on 2021-10-29 supports the R2C and is based on OpenWRT 21.02.1 with kernel 5.10. So I wonder if we could just use the YT8521S driver from FriendlyWRT and use it with OpenWRT master branch.

I was able to take FriendlyWRT's patch that adds support for the R2C and apply it to OpenWRT master. So I built an OpenWRT image for the R2C with kernel 5.10.82, and in theory it should include a driver for the YT8521S. Would anyone be willing to test this build while I'm waiting for mine to arrive? It includes the following extras:

  • luci-app-adblock
  • luci-app-banip
  • luci-app-sqm
  • luci-app-minidlna
  • luci-app-openvpn
  • luci-app-wireguard
  • dnscrypt-proxy2
  • curl
  • nano
  • 256MB root partition

Version string is r18245-7a48dfc90c

squashfs:
https://drive.google.com/file/d/1F4u42zHznU5uC14j2tbv8f4fAGWe7llq/view?usp=sharing

ext4:
https://drive.google.com/file/d/1GmUiOouWa2oFwYUflWL2B7HpEdVfh4XF/view?usp=sharing

If anyone gives it a try, let me know how it goes.

Your load works. I haven't iperf performances test yet but its passing traffic and looks good. Can you post the driver patch/source you used for this so I can make sure we are looking at the same. Thank you!

I applied this friendlywrt commit to openwrt master:

You can add .patch to the end of the url above and then apply it to openwrt using git apply.

The problem is that they modified the R2S profile instead of making it a separate device. But good to hear it works. Maybe we can take some of the work from this commit and put it into a new device profile for R2C. Devs on the openwrt github don't like that it's not an upstream driver, and I'm not sure if friendlyarm will submit the motorcomm driver upstream or if someone else needs to.

1 Like

When I checked with them, they seemed very uninterested in doing too much work to get this integrated in openwrt.

I finally got my R2C and did a new build today by applying the same patch above to openwrt master. Only issue was that the patch tries to modify some kernel 5.4 stuff that is no longer present in openwrt master. But the build is working and I'm currently using it as my main router. Using cake SQM at 100Mb gives me about 0.25 cpu load, so if scaling is linear I would guess it could handle somewhere around 400Mb/s with cake.

My new build is below and includes the following packages:

  • luci-app-adblock
  • luci-app-banip
  • luci-app-sqm
  • luci-app-minidlna
  • luci-app-wireguard
  • dnscrypt-proxy2
  • curl
  • nano
  • 256MB root partition

Version string: r18437-92820cc5b9
Kernel: 5.10.88

squashfs:
https://drive.google.com/file/d/1kw7UQ5K5foZ_44FrAsgHFpHFt0hlCdZy/view?usp=sharing

ext4:
https://drive.google.com/file/d/1nKgfhSGs1QxT5cHse5kqrmTrxMEW0dJz/view?usp=sharing

FriendlyWrt has merged R2C support into their master branch and now it's set up properly as a separate device from the R2S, so I did a new build today. I have been using the squashfs image with no issues so far.

Info:

  • Vanilla OpenWrt master + patches from FriendlyWrt for R2C support
  • ImmortalWrt patch for 1.6ghz overclock.
  • microSD soft reboot patch
  • 512MB root partition
  • openwrt master just switched to firewall4 / nftables by default, but it breaks banip so I built this with firewall / iptables
  • kernel 5.10.92
  • version string r18614-46ce629fe0

Packages:

  • luci-app-adblock
  • luci-app-banip
  • luci-app-ddns
  • luci-app-sqm
  • luci-app-wireguard
  • curl
  • nano

squashfs:
https://drive.google.com/file/d/1aOE8vgfTQhmtRwn1kOa3YrcOl4VHwKDn/view?usp=sharing

ext4:
https://drive.google.com/file/d/16aUZF56T08t234rc5PrQ8gZAEfmAgb-E/view?usp=sharing

2 Likes