-
-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test Seeed Studio's Dual Gigabit CM4 Carrier Board #137
Comments
Is the seeed studio's dual gigabit cm4 carrier board a commercial board? I was a little confused about on your web . and seeed seems to launch a new carrier board for cm4 named reterminal. Maybe you can add it to your web, and, also, Hope to see your test! Here is the link of that boardhttps://wiki.seeedstudio.com/reTerminal/ |
@ruobinl - Can you open a new separate issue for the reTerminal? I would love to get it added. Seeed's board seems to be available now, so if it's still under 'prototype' it should be updated on the site. |
This board uses a USB-to-Gigabit network adapter, the Microchip LAN7800. It's been in the mainline Linux kernel since 4.x I think, but on first attempt with OpenWRT it didn't seem to identify the controller. Might have to dig in a bit more or build a custom kernel :/ |
From https://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/ I downloaded the I then wrote it to the card:
Then transferred the card to the Seeed board and booted. The Pi starts booting, and the lights on the ETH0 port light up, and the kernel gets to this point but seems to stop booting:
|
Hmm... there's actually an rc build of 21.02 from April 20! See: https://downloads.openwrt.org/releases/21.02.0-rc1/targets/bcm27xx/bcm2711/ I'll give that a go. Edit: Note, exact same issue. I also noticed the board gets HOT. Maybe packing in the USB controller, Ethernet controller, and Pi right on top (plus looks like some power bits on the bottom?) is not the best solution for thermals. I'll test it under IR in a bit. |
I just flashed normal Pi OS to the microSD card and am trying to boot from that. |
Pi OS boots, and I get:
And it looks like the interface is there and it's up, but the LEDs on the port don't actually light up... that's kind of a bummer.
|
Going to try to control the LEDs:
Using it:
Nothing made a difference, I have to wonder if maybe the LEDs aren't wired in at all somehow? |
Going to set up the Seeed board as a very simple router:
At this point I disconnected all my other Mac interfaces and was getting all my connectivity through the Pi. |
(Reminder: all benchmarks are run from my Mac, connected solely through the Pi router (WiFi disabled, 10G NIC is unplugged) to the rest of my network.) First benchmark is Speedtest.net, which gives 466 Mbps down, and 39 Mbps up. Second is Going in reverse (
|
Next up, calculating packets per second (pps), I got:
(Note that to decrease the massive amount of packet loss, I doubled the interval from 15 to 30.) Result: 36,703 pps, which is just less than half of the result I got on DFRobot's board. Using LAN-over-USB is really killer—or maybe just the driver/featureset of the Microchip LAN7800 :/ |
I'm re-flashing the OS and will test just the USB-to-Gigabit side (LAN1 port) by itself, using |
So even on the Pi direct (I have it's LAN1 port plugged into my regular home network, fresh Pi OS install with just In reverse (to the Pi), I can get 940 Mbps from my router (but interestingly, not from my Mac connected directly through my office switch). But traffic flowing from the Pi over that interface maxes out at 700 Mbps. On the built-in interface, I'm seeing 930-940 Mbps consistently. |
LAN7800 is the same USB to gigabit ethernet chip used on Pi3B+, so it is in the bcm2709, bcm2711, and aarch64/bcmrpi3 and aarch64/bcm2711. LED support depends on the EEPROM or OTP setting in the chip. See raspberrypi/linux@c0e68a6 for a patch added to handle things in the absence of an EEPROM (eg on Pi3B+) |
Please try to download OpenWRT from:https://openwrt.org/toh/hwdata/raspberry_pi_foundation/raspberry_pi_foundation_raspberry_pi_4_b "Firmware OpenWRT snapshot install" |
@SeeedRobin - Good point, the board does get quite hot (and not just the CM4 — it seems to be staying under throttling temperatures). I'll try putting a decent amount of airflow through the gap between the board and CM4 and see if that helps. And @6by9 I'll see what I can do—maybe I can figure out a workaround using the device tree or something from that patch. Didn't realize it's the same chip used on the 3B+! |
@SeeedRobin - I tried downloading the
I'm going to try the |
With
...oooooh... Just found this comment:
Actually, since I can use the USB 3.0 ports, I don't have to enable USB 2.0 in /boot/config.txt. Yay! |
All right, I have the Pi booted and tried running |
Trying the factory 21.02 rc release now (https://downloads.openwrt.org/releases/21.02.0-rc1/targets/bcm27xx/bcm2711/). Same result. Going to see if I can manually add a WAN port (https://www.onetransistor.eu/2017/04/wan-port-openwrt-lede-vlan.html). Via console, ran:
And that did it! I can get |
Weird thing, though—for some reason even though the USB 3.0 ports are working (I'm typing on a keyboard plugged into one of them), the 2nd network interface seems to not be recognized. In LuCI it's not showing me an option of another interface for a WAN port... Weird, because it 'just works' in Pi OS, but it's not seen at all using OpenWRT. Going to install USB utils and PCI tools and see what the bus says. |
Installed usbutils using the Web UI and on the console I ran
0424:7800 is, I believe, the 7800 chip. So not sure why it's not loading.
|
I wonder if the BCM2711 config target used for the Pi 4-compatible OpenWRT image doesn't include the |
Looks like they've removed the lan78xx driver from their kernel then. Can you do the normal |
@6by9 - Yeah, looks like that's the case (you and I came to the same conclusion within 23 seconds ;)
Definitely not in their build for the 2711: https://github.com/openwrt/openwrt/blob/master/target/linux/bcm27xx/bcm2711/config-5.4 For now, I'm thinking I'll stick with not using OpenWRT just because I've already put in a bit more time than I should be on this particular board. I'll re-benchmark on Pi OS with better cooling and see what the results are there. And I'll have to mention in my eventual video that right now, at least, OpenWRT's images don't have support for the 2nd port on the Seeed Studio board (AFAICT). Seeed could build a custom image like DFRobot is currently to add in that support, or maybe see if OpenWRT would be willing to merge this PR (openwrt/openwrt#4191) to add support upstream. (cc @SeeedRobin) |
I can recompile an OpenWrt with that change and provide an image so you can do your tests. It's pretty quick to do, I have a build environment for OpenWrt set up already. |
Here a zip with images compiled. There is also luci web interface included https://drive.google.com/file/d/1ARejcyKqpbqC6mpM_amGMPDCSyloddFA/view?usp=sharing |
@bobafetthotmail - Thanks! I'll test it out tonight or tomorrow morning! |
@bobafetthotmail - I have it installed, had to set up a custom IP on the eth0 interface to access it and get
And it shows up as a usable interface:
So looks like it works! I'll reformat my PR in a bit. |
good. In devices with more than one port, OpenWrt usually sets up the second one as WAN and dhcp client (so it becomes a router). But obviously this is not the case for raspberry because it's defined as single-port device and so it is configured just with a LAN interface. You can add a new interface to use that new port by going to Network -> Interfaces and then click on the button Add a new interface on the bottom left. Then you give a name like WAN, and choose "Static interface" or "DHCP client". then save the change. Otherwise if you want to use commandline, add this to the /etc/config/network
to create a WAN interface set as dhcp client and add this (or check if it's there already, I don't know) to /etc/config/firewall
Now it is set up like a router, with a LAN and a WAN interfaces. then run
so the system reloads the configs you just changed. |
@bobafetthotmail - I can confirm that all I needed to do was make the following addition to
The firewall rules were already present. Now it's working the same as the DFRobot board, so I can do 1:1 comparisons, yay! |
I thought I'd try getting WiFi working on the Seeed board with it's OpenWRT install—and I finally ran into this forum topic, which led me to the
Looks like I need to set the country code and maybe then WiFi can work? Well, I tried setting it but still nothing:
Kernel module is loaded, too:
Hmm... dmesg:
Ah... found openwrt forum: Raspberry Pi CM4 wifi not working — I'm not alone. |
Trying the following based on this slackware forum topic:
...and voila! It works! I posted this to the OpenWRT forum as well.
|
Except it doesn't; can't see SSID after setting it in AP mode, and getting this in dmesg:
|
I set the channel to |
Ouch; download is 58.94 Mbps, upload is 31.18 Mbps. To be expected—even without AP mode, onboard WiFi never gets past about 80-90 Mbps download speeds in my experience (even with an external antenna on the CM4).
But... this is making me more excited about the possibilities with my dual-2.5 GbE 802.11ax 6E build I'm going to attempt! Plus... if you're someone with < 50 Mbps of Internet, or you just stream < 4K video to one or two devices—60 Mbps is plenty adequate. The built-in chip kinda falls apart with more than maybe 10 devices connected, though. |
Yeah that's because the wifi module is wired on the SDIO interface. It's decent enough for what it is, but it's not AP-grade hardware by any stretch, anything on PCIe lanes is going to be so much better. |
@bobafetthotmail - Definitely; but a lot of people might not know that and would expect that "The Pi has 802.11ac, so it should be as good as [insert router here] with 802.11ac!" :) Have to get the raw numbers and be able to demonstrate how much different it is. I wish I had a wireless testing lab like giant megacorps have, I'd probably spend a few months on just one device :D |
I have no idea what just happened, but my results comment just completely vanished, so I have to re-test some things:
|
@geerlingguy , hi! |
@mingzhangqun - Thanks; looks like the script in question is here: https://github.com/Seeed-Studio/seeed-linux-dtoverlays/blob/mipi_dsi/scripts/cm4_lan7800.sh I'll give this a try and re-run speed tests to see what the difference is. Did you run it and see what the overall difference was? And is there any chance the optimizations you have in that repository might be contributed back to the Linux kernel so it can be improved for other users of the LAN7800 chip? |
Odd statement. Neither of which have any functional difference. There are a couple of downstream patches, and potentially raspberrypi/linux@d5a91b7 will alter the total throughput because it changes the urb period (can be changed through a module parameter), and disabling Transmit Segment Offload pushes more processing onto the CPU (again should be possible to disable through a module parameter). Minor concern that your version of the files don't match up with mainline, then again it appears at first glance to only be a module rename from lan78xx to lan7800. |
@6by9 - My guess is it won't make a substantial difference, but I'll test it to be thorough. Most of the USB-to-gigabit adapters I've tested on the Pi seem to top out under 800 Mbps anyways, so it's not a big surprise. |
Interesting result—
I'll set it up as a router and see if it can pump more packets through too... Just noting that it's a lot harder to try to get these changes into an OpenWRT build (compared to downloading git repo and running a shell script...). And I'd like to know what changes specifically lead to this result? |
Acting as a router, my Internet speed test results are actually a bit worse: https://www.speedtest.net/result/11480334630 Monitoring with So while it seems the patch does help in terms of hitting one interface, total router throughput (between the two interfaces) still seems to suffer quite dramatically...
So it seems the optimizations in the Seeed repo only really affect |
Since Raspi is quadcore, you can try enabling multicore routing or "packet steering" by Maybe it will spread that 81% CPU load more on other cores too. Another thing you can enable to get more performance is "Software Flow Offloading" that is a firewall option to bypass some intensive routing functions (hence why the option says that "may break SQM/QoS functionality", which is the Quality of Service packet prioritization, optional functionality not everyone uses) Or edit /etc/config/firewall to add option flow_offloading '1' to the defaults section
None of these options are specific for Raspberry, if you have other devices that have multiple CPU cores or you are not using QoS/SQM packages you can also try them. |
@bobafetthotmail - I'll test that out under OpenWRT soon—just a note that last time I was fiddling with NICs on the Pi, I was unable to get anything to work for distributing packets among cores. I don't remember which board it was, but I found that at least |
Video is up today! https://www.youtube.com/watch?v=w7teLVwi408 |
just a short note on the above... ( re: irq )... rps / xps (packet_steering) is said to assist with 'multi client , multi stream'... although YMMV varies depending on nic drivers ( onboard supports a bit... most usb not so much... ) biggest improvement imho is 'irq_affinity' for both eth0 interrupts ( 'c' or 'a' maybe )... the aim is to distribute eth0 interrupts across several cores... ( which afaik is also the only thing irqbalance is capable of also distributing )... usb interrupts are likely also statically somewhat bound... so we distrubute eth0 as this is a known distributable entity... |
See the Dual Gigabit Ethernet Carrier Board for Raspberry Pi Compute Module 4.
It has two USB 3.0 ports, plus an internal USB 3.0-to-Gigabit Ethernet bridge chip so it can have two Gigabit Ethernet ports.
I'm going to test it alongside the DFRobot Routerboard.
The text was updated successfully, but these errors were encountered: