NanoPi R4S rk3399 R6S RK3588S 4G is a great new OpenWrt device

I have question @walmartshopper, and to who ever else is using the r8168 driver...

When using the r8168 driver, are you also selecing the r8169 firmware and the kmod-phy-realtek? In other words, these:

and

Or are you just selecing the r8168 driver and nothing more?

1 Like

Uhm I was configuring it, I installed my packages (also the luci package that displays your mount points in the GUI, block-mount? IIRC), then I updated with the latest snapshot build, rebooted and…

…my root partition has been resized again to 100MB!

Hmmm this is annoying.

So I tried to resize it again to fill the sd, done it via gparted, but when I tried to expand the root I got an error in the sd

root@nanoPi-R4S:~# fsck.f2fs -f ${LOOP}
Info: Force to fix corruption
Magic Mismatch, valid (0xf2f52010) - read (0x6320)
Can't find a valid F2FS superblock at 0x0
Magic Mismatch, valid (xf2f52010) - read (0x2005)
Can't find a valid F2FS superblock at 0x1

I have only a screenshot because if I copy/paste it gets bad formatted:

I tried to mount and repair the file system from the other OpenWrt router (mounted as USB) but I wasn’t able to repair it. The error was still there.

I had the partition correctly resized but I was unable to expand the fs inside it.

So in the end I want to do a clean installation, I was annoyed, I cleared the sd card, reinstalled all again, (I had the backup of packages/settings) and I flashed the squashfs build.

Now I’m again with the 100mb in the main partition but I’m frustrated to understand what’s going on.

I can resize it again and expand (if I get no errors) but then again I’m scared that it will be automatically resized to 100mb.

So I’ll leave the 100mb as root, I don’t need more space, I’m using 2/3mb but I wonder why it gets resized. Probably is because I’m using the online build server.

My only problem is the wearing of the microSD, cause if OpenWrt writes and rewrites only in this 100MB the sd will last nothing. I hope something like the TRIM or GC works well and the blocks used are not always the same inside this 100mb.

But I also don’t know what to do with the other free space.

With my old config I was writing all the collectd stats to an external USB drive, in order to save the internal drive wear and then I was importing it into a graphs a server to build some stats and get alerts when the temperature is to high or there’re lots of packets queued in th SQM, etc… see here: http://giuliomagnifico.blog/networking/2022/06/02/my-network-home-setup.html

Maybe I can use the other free space to save the data instead of the external USB drive? Hmmm :thinking: if the USB drive became corrupted I can replace it but if it’s the microSD with the main system also, it’s annoying and I will be also offline.

Any other suggestion with all of this free space in the microSD?

What are you using it for?

Thanks

I'am using only r8168 in my test build. In the realtek driver package there is r8168_firmware.c + r8168_firmware.h

imo selecting r8169 firmware is not needed because you dont use it. saves you some space.

I've got now 2x NanoPi R4S. 1GB and 4GB variant. Both are working fine with patched OpenWrt.

I'am using r8168 + friendlyarm u-boot patches + armbian u-boot patches for 1GB version.
I have to stress test them in next few days/weeks before I will use the 4GB variant as my main router. After that I will release weekly builds and try to push u-boot patches to official.
But first I have still some things to learn.. :sweat_smile:

2 Likes

I just select kmod-r8168 and unselect kmod-r8169. I did not unselect kmod-phy-realtek or r8169-firmware. I don't think they get used when r8168 is loaded, but it doesn't seem to hurt anything leaving them enabled.

1 Like

Finally (quite quick, 1-2 day) I configured everything and I added the R4S to my setup (I still have to cut/build the length of the cables)

PS: I still don't know what to do with all the space in the microSD :sweat_smile: because for the stats and push notifications I'm using a USB disk, I'm scared of the wear of the SD.

I've found also that's possible to write two exporters in the same database, so I'm writing both the R4S stats (hardware) plus the R7800 stats for the wifi details, and they look like only. Very useful, so I can get push notification for temps, ram, uptime, etc... of the R4S and the wifi push for wifi stats, connected clients, etc.. for the R7800 all in the same Grafana istance and dashboard. Cool!

I'm still building it, since the queries now are different I have to change all (that's annoying but one time only)

I placed the R4S on 3 spikes, because the metal case is getting very hot (the temps inside are low), so it works well but maybe the heat can damage (make a mark) on the forniture, I have to find something better to place under it:

Now I have to search an AX access point, probably the Unify 6 lite :thinking:

Edit: do someone know where are the thermal_point 0 and 1? Because they’re reporting almost the same temp (less than 0,5° difference), so I’m curious to find out where are they and if is useful monitoring both. Thanks

1 Like

I'd suggest the U6-Lite or U6-Mesh. I run the U6-Lite and it's an awesome wifi 6 AP for $100, very fast, supports single login, mesh, twt, etc. Just be sure to get a poe injector ($10 extra) if you don't have a poe switch. I run that with a WRT32X as my main router, handles SQM cake at 500/30 Mbits cable modem, firewall, samba, usb3 storage, etc. Been messing with the new R5S considering an upgrade when the firmware gets more dev time.

1 Like

Unless you have some ultra-cheapo garbage microSD - wear levelling is done by the MicroSD's built-in controller itself. The free space is your friend, the controller knows that it's got lots and lots of free flash to wear level over.

Hmmm, are you sure of this? For what I know SD and microSD don't have any controller inside and all is done from the board where're installed, only from the CF and above have the controller.

I'm looking at the options... Maybe the 6 Long Range is the best choice because the 6 Lite has only 2x2 5GHz antennas, yes it's wifi 6 but it's a dowgrade from my 4x4 wifi 5 R7800, because I have 5/6 clients connected. The 6LR has 4x4 antennas.

Also because in Europe the 6L costs 160€ (165$) on amazon, the 6LR 220€ (226$)... both are (lot) more expensive than U.S. :triumph:

The U6-Mesh has OpenWrt support?! It's not listed n the TOH: https://openwrt.org/toh/ubiquiti/start

Hey all,
I just replaced my old router with a nanopi r4s, running 22.03-rc5, and I'm trying to get SQM tweaked properly. My connection is PPPoE over Fiber, 600/60. With my old router, I was using sqm with these settings:

config queue 'eth0'
	option qdisc 'cake'
	option script 'piece_of_cake.qos'
	option interface 'pppoe-wan'
	option download '550000'
	option upload '58000'
	option linklayer 'ethernet'
	option overhead '44'
	option debug_logging '0'
	option verbosity '8'
	option enabled '1'

And I was getting a pretty consistent 510/54 using the speedtest CLI on the router directly.

With the nanopi r4s, I can get 555/48 without sqm, but as soon as I enable SQM, it drops to 510/10. The 510 down is fine, but I can't figure out why my uploads are so awful.

I currently have packet steering and software offloading on, and I've tried setting IRQs to both of these (from the device page):

echo 1 > /proc/irq/35/smp_affinity
echo 2 > /sys/class/net/eth0/queues/rx-0/rps_cpus
echo 4 > /proc/irq/87/smp_affinity
echo 8 > /sys/class/net/eth1/queues/rx-0/rps_cpus

and/or

echo f > /proc/irq/35/smp_affinity
echo f > /proc/irq/87/smp_affinity
echo 30 > /sys/class/net/eth0/queues/rx-0/rps_cpus
echo 30 > /sys/class/net/eth1/queues/rx-0/rps_cpus

(yes, I reran these after updating the SQM config)

People are talking about gigabit... any ideas what I'm doing wrong?

(edit: old router was a NUC with an N3050, so possibly a bit more powerful, but I'd still expect this one to be fine for 600/60... and I'm mostly confused by why download is totally fine but only upload is borked)

Did you try to turn it off?

Yes; no noticeable difference (I also tried hardware offloading, but I didn't expect that to change anything, and it didn't)

Taking a look at CPU use by core with htop (turn on the clock speed display option also) during a speed test might provide some clues?

I just have irqbalance, packet steering and software offload enabled on my R4S - nothing fancy setting IRQ's manually. I only have 400/20 ISP service, but no issues getting all 20 on upload with CAKE.

Hardware offloading isn't supported on this hardware, and Software offloading doesn't work with SQM or any QoS so just leave them both unchecked.

I would get rid of all those settings and start simple with only enabling SQM, cake, poc, 550000, 58000 and see if it works. Maybe also try fq_codel. Then after testing a simple setup add the options to see if it changes.

1 Like

htop was a good idea... but it didn't seem to show me anything useful. CPUs 2 and 4 were much more heavily loaded during download (aka 500Mbps) and relatively lightly (but still the most of all of them) during upload. I didn't see anything that looked like a bottleneck or anything maxing out :-/

I've turned off software offloading, and went back to the most basic parameters. Still can't seem to get above 11Mbps.

With fq_codel + simple, I can hit 510/50, interestingly.

Edit: I'm not sure fq_codel actually worked. I saw this in the logs when selecting fq_codel:

Wed Aug  3 16:27:07 2022 daemon.err modprobe: failed to find a module named act_ipt
Wed Aug  3 16:27:07 2022 daemon.err modprobe: failed to find a module named sch_fq_codel
Wed Aug  3 16:27:07 2022 daemon.err modprobe: failed to find a module named act_ipt
Wed Aug  3 16:27:07 2022 daemon.err modprobe: failed to find a module named sch_fq_codel

Yea fq_codel looks broken, not sure why, I use Cake on my main router (WRT32X, 500 / 35 Mbit cable, SQM works perfect on rc6). Maybe do a clean install of the new rc6 and start fresh something seems wrong.
[OpenWrt 22.03.0-rc6 sixth release candidate]

Another option if you have time is to try a FriendlyWrt build (in their testing folder, it's based off OpenWrt 22.03-rc) they post every few weeks here, not sure what tweaks they might add for this hardware:
https://www.friendlyelec.com/index.php?route=information/information&information_id=7

For that I was saying to disable it. But if he says there’s no difference…I have no idea. On my 200/20 SQM works perfectly and waay better that the R7800. I have no lag.

@mikeage try to paste here the output of cat /etc/config/sqm

fq_codel is generally compiled in in openwrt. sqm-script's I thought didn't check for ipt anymore either (@tohojo) ? your problem is elsewhere... :confused:

Perhaps in the ppoe decoding?

Responding to everyone:

The pppd process doesn't seem to be using any significant amount of CPU.

I feel like fact that it's only on the upload and not download is significant. If I set upload to 0, it looks fine. If I set it to something like 100000 (well above my theoretical maximum of 60000ish), it still stays at around 10Mb.

Here's my current config:

config queue 'eth0'
	option download '550000'
	option interface 'pppoe-wan'
	option debug_logging '0'
	option verbosity '5'
	option qdisc 'cake'
	option script 'piece_of_cake.qos'
	option upload '58000'
	option linklayer 'none'
	option enabled '1'

If fq_codel is compiled in, that's good to know; truth is, I know it works, because it throttles the download as well. I was using cake / piece_of_cake before and I'd like to continue, but I suppose fq_codel + simple is probably better than nothing, right?

rc6 is probably a good idea, although as this is my main router, I need to wait until I have time to redo everything in case it goes south, so it's not going to happen today :slight_smile:

tc -s qdisc show during your upload or download might be revealing.

1 Like