0008 MPS2.5G(SSD and 2.5G ETH):修订间差异

来自Mcuzone Wiki
第115行: 第115行:
== '''V. Work with Ubuntu System''' ==
== '''V. Work with Ubuntu System''' ==


=== 5.1 2.5G网络测试 ===
=== 5.1 2.5G Ethernet test ===
Ubuntu系统下需安装2.5G网卡驱动才能使用,本文档以Ubuntu 24.04为例。
In Ubuntu system, the 2.5G network card driver needs to be installed to use the device.


首先需要更新系统:
First, you need to update the system:


<code>sudo apt-get update</code>
<code>sudo apt-get update</code>
第124行: 第124行:
http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_09.jpg
http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_09.jpg


接着准备编译环境:
Next, prepare the compilation environment:


<code>sudo apt-get install --reinstall linux-headers-$(uname -r) linux-headers-generic build-essential dkms</code>
<code>sudo apt-get install --reinstall linux-headers-$(uname -r) linux-headers-generic build-essential dkms</code>
第130行: 第130行:
http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_10.jpg
http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_10.jpg


然后安装驱动:
Then install the driver:


<code>sudo apt-get install r8125-dkms</code>
<code>sudo apt-get install r8125-dkms</code>
按提示安装即可:


http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_11.jpg
http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_11.jpg


安装完成后输入:
After installation is complete, excute:


<code>sudo modprobe r8125</code>
<code>sudo modprobe r8125</code>
第150行: 第148行:
http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_13.jpg
http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_13.jpg


输入<code>ifconfig -a</code>就可以看到enxxx的网卡接口,这样就安装完毕2.5G网卡驱动:
Enter <code>ifconfig -a</code> to see the network interface called enxxx, which indicates that the 2.5G network card driver has been successfully installed:


http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_14.jpg
http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_14.jpg


利用iperf3,在树莓派OS与PC之间进行测速。
Use iperf3 to perform a speed test between the Ubuntu system and the PC.


当Ubuntu系统作为client时,速度大约为2.26Gbps:
When Ubuntu system acts as a client, the speed is about 2.26 Gbps:


http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_15.jpg
http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_15.jpg


当Ubuntu系统作为server时,速度大约为1.70Gbps:
When Ubuntu system acts as a server, the speed is about 1.70 Gbps:


http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_16.jpg
http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_16.jpg


'''''注意:网络测速受网络环境和测试方法影响,速度请以实际为准,本测试仅供参考。'''''
'''''Note: Network speed tests are affected by network conditions and testing methods. The actual speed may vary; this test is for reference only.'''''


=== 5.2 SSD硬盘测试 ===
=== 5.2 SSD test ===
关于对SSD硬盘的基本操作,我们可以参考以下链接,除了SSD用作存储扩展中与树莓派OS下操作略有不同,其余部分基本相同:
For basic operations on the SSD drive, we can refer to the following link. Only the SSD being used as storage expansion having slightly different operations under the Raspberry Pi OS, the rest of the processes are largely the same.


[[0005 MPS2242 2280(单SSD扩展板)#5.1 SSD用作存储扩展|SSD用作存储扩展(Ubuntu系统下)]]
[[0005 MPS2242 2280 2280P(Single SSD Expansion Board)#5.1 Use the SSD for storage expansion|1. Use the SSD for storage expansion(Ubuntu system)]]


[[0005 MPS2242 2280(单SSD扩展板)#六、对SSD进行分区等操作|对SSD进行分区等操作]]
[[0005 MPS2242 2280 2280P(Single SSD Expansion Board)#VI. Perform partitioning and other operations on the SSD|2. Perform partitioning and other operations on the SSD]]


[[0005 MPS2242 2280(单SSD扩展板)#cite ref-1|调整外设启动顺序]]
[[0005 MPS2242 2280 2280P(Single SSD Expansion Board)#cite ref-1|3. Adjust the boot devices order]]


[[0005 MPS2242 2280(单SSD扩展板)#7.2 在PCIe Gen2下测试硬盘速度|安装硬盘测速软件hdparm]]
[[0005 MPS2242 2280 2280P(Single SSD Expansion Board)#7.2 Test the SSD speed in PCIe Gen2 mode|4. Install the SSD speed testing software hdparm]]


因为MPS2.5G无法工作在PCIe Gen3模式下,所以我们无需更改PCIe模式,直接使用hdparm软件测试速度即可。
Since the MPS2.5G cannot operate in PCIe Gen3 mode, we do not need to change the PCIe mode and can directly use the hdparm to test the speed.


在Ubuntu终端下运行<code>df</code>,查看SSD分区名为nvme0n1p1和nvme0n1p2:
Run <code>df</code> in the terminal to check the partitions' name of the SSD, which are nvme0n1p1 and nvme0n1p2:


http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_17.jpg
http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_17.jpg


我们选一个进行测速:
We select one to perform a speed test:


<code>sudo hdparm -t /dev/nvme0n1p1</code>
<code>sudo hdparm -t /dev/nvme0n1p1</code>


运行命令,可多次运行,测试多次硬盘速度:
Excute the command; it can be executed multiple times to test the disk speed repeatedly:


http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_18.jpg
http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_18.jpg


可见此测试硬盘的运行速度为430Mbps左右。
The test shows that the operating speed of this disk is about 430 MBps.


'''''注意:硬盘运行速度受硬盘质量、硬盘上的文件存储情况等多种因素影响,以上测试结果仅供参考,不作为实际产品的最终参数。'''''
'''''Note: The disk operation speed is affected by various factors including the quality of the disk and the file storage situation on the disk. The above test results are for reference only and do not represent the final parameters of the actual product.'''''


== '''六、OpenWrt系统操作演示''' ==
== '''VI. Work with OpenWrt System''' ==


=== 6.1 概述 ===
=== 6.1 Overview ===
MPS2.5G扩展板在OpenWrt系统下可配置为二进二出的交换机模式,扩展板上的2.5G网口作为WAN口(连接Internet),或者树莓派5上的内置WiFi作为WAN口(连接Internet),树莓派5上的网口配置为LAN口,用于连接PC,或者树莓派5上的内置WiFi作为无线AP,连接手机等设备。
The MPS2.5G expansion board can be configured as a two-in-two-out switch mode under the OpenWrt system. The 2.5G Ethernet port on the expansion board can be used as the WAN port (connected to the Internet), or the built-in WiFi on the Raspberry Pi 5 can be used as the WAN port (connected to the Internet). The Ethernet port on the Raspberry Pi 5 is configured as a LAN port for connecting to a PC, or the built-in WiFi on the Raspberry Pi 5 can be used as a wireless AP to connect devices such as smartphones.


=== 6.2 准备工作 ===
=== 6.2 Preparation ===
本文档使用的OpenWrt系统为:openwrt-bcm27xx-bcm2712-rpi-5-squashfs-sysupgrade-linux-6.1.100-20240805.img.gz
After flashing the OpenWrt system and powering it up, we connect an Ethernet cable from the Raspberry Pi 5's built-in Ethernet port to the PC's Ethernet port, connect the Ethernet cable from the router to the 2.5G Ethernet port on the expansion board.Once the connection between the PC's network card and the Raspberry Pi's Ethernet port is successful, we find Network and Internet settings in Windows, then open the connected network under Ethernet to view the default gateway IP address. This address is the backend configuration page address for the OpenWrt system. As shown in the figure, the address for this test is 192.168.198.1:
 
烧写OpenWrt系统并上电启动后,我们通过树莓派5上的网口连接网线至PC网口,将联通外网的网线连接到扩展板上的2.5G网口,待PC的网卡与树莓派5上的网口连接成功后,我们在Windows设置中找到网络和Internet,在以太网中打开连接的网络查看默认网关的IP地址,这个地址就是OpenWrt系统的后台配置页面地址,如图所示,本文测试的地址为192.168.198.1:


http://www.mcuzone.com/wiki/2001_CM4_Ultra/2001_CM4_Ultra_53.jpg
http://www.mcuzone.com/wiki/2001_CM4_Ultra/2001_CM4_Ultra_53.jpg


然后打开网页浏览器输入192.168.198.1进入OpenWrt系统。默认用户名为<code>root</code>,默认密码为<code>password</code>
Then open a web browser and enter 192.168.198.1 to access the OpenWrt system. The default username is <code>root</code>, and the default password is <code>password</code>:


http://www.mcuzone.com/wiki/2001_CM4_Ultra/2001_CM4_Ultra_54.jpg
http://www.mcuzone.com/wiki/2001_CM4_Ultra/2001_CM4_Ultra_54.jpg


=== 6.3 PC通过2.5G网口上网 ===
=== 6.3 PC accesses the internet through the 2.5G Ethernet port. ===
打开“网络 - 接口”,点击“添加新接口”:
Open "Network - Interfaces", and click "Add new interface":


http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_19.jpg
http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_19.jpg


接口名称设置为WAN,接口协议选择DHCP客户端,接口选择eth1后点击“提交”按钮:
Set "Name of the new interface" as WAN, choose "DHCP client" for "Protocol of the new interface," select "eth1" for "Cover the following interface," and then click the "SUBMIT" button:


http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_20.jpg
http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_20.jpg


在防火墙设置中选择WAN口后点击“保存&应用”按钮:
In the "Firewall Settings", select the WAN and then click the "SAVE & APPLY" button:


http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_21.jpg
http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_21.jpg


回到“网络 - 接口”,稍等片刻,就可以看见新建的WAN接口获取了IP地址,这样PC就可以通过MPS2.5G扩展板上网了:
Go back to "Network - Interfaces", wait a moment, and you will see the newly created WAN interface has obtained an IP address. This way, the PC can access the internet through the MPS2.5G expansion board:


http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_22.jpg
http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_22.jpg


上网测速结果如下:
Open https://www.speedtest.cn/ on the PC to test speed. The test results are as follows:


http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_23.jpg
http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_23.jpg


'''''注意:网络测速受网络环境和测试方法影响,速度请以实际为准,本测试仅供参考。'''''
'''''Note: The speed test can be affected by the network environment and the testing method. Speeds should be considered based on actual results; this test is for reference only.'''''


=== 6.4 树莓派自带WiFI做无线AP(master模式)使用 ===
=== 6.4 Use the Raspberry Pi's built-in WiFi as a wireless AP (in master mode) ===
默认状态下,树莓派5自带的无线模块已经配置成了无线AP,我们在在“网络 - 无线”可以看到这个AP:
By default, the wireless module included with the Raspberry Pi 5 is already configured as a wireless AP, which we can see under "Network - Wireless":


http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_24.jpg
http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_24.jpg


点击“修改”,在“接口配置 - 基本设置”中,可以看到该AP的SSID:
Click "Edit", and under "Interface Configuration - Basic Settings", you can see the SSID of this AP:


http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_25.jpg
http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_25.jpg


我们用手机去搜索这个AP,连接上以后即可上网(手机连接树莓派5原生无线网卡作为的AP,2.5G网口作为WAN口连接上级路由器,原生千兆网口作为LAN口连接PC):
We can use a smartphone to search for this AP, and after connecting to it, we can access the internet (the smartphone connects to the AP created by the Raspberry Pi 5's native wireless network card, the 2.5G Ethernet port acts as the WAN port connected to the upstream router, and the native Gigabit Ethernet port acts as the LAN port connected to the PC):


http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_26.jpg
http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_26.jpg


=== 6.5 树莓派自带WiFi做Client使用 ===
=== 6.5 Use the Raspberry Pi's built-in WiFi as a Client ===
本节主要内容是讲述如何使用树莓派自带WiFi做Client,即树莓派通过WiFi连接至上级路由器。
This section mainly describes how to use the Raspberry Pi's built-in WiFi as a client, meaning the Raspberry Pi connects to an upstream router via WiFi.


在“网络 - 无线”中查看无线概况:
View the wireless profile under "Network - Wireless":


http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_27.jpg
http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_27.jpg


点击“扫描”按钮,扫描出附近的无线AP:
Click the "Scan" button to scan for nearby wireless APs:


http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_28.jpg
http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_28.jpg


选择一个进行连接,防火墙选WAN:
Select one to connect, and choose WAN for the firewall:


http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_29.jpg
http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_29.jpg


然后按“提交”,提交后在点击“保存&应用”:
Then click "SUBMIT", and after submitting, click "SAVE & APPLY":


http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_30.jpg
http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_30.jpg


成功后再回到“无线概况”,就能看到此时无线已经连接成功:
After succeeding, go back to "Wireless Overview", and you will see that the wireless connection has been established successfully:http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_31.jpg
 
http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_31.jpg


回到“网络 - 接口”,可以看见新建的WAN接口获取了IP地址,这样PC就可以通过无线模块连接上级路由器上网了:
Go back to "Network - Interfaces", and you can see that the newly created WAN interface has obtained an IP address. The PC can connect to the internet through the wireless module and the upstream router:


http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_32.jpg
http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_32.jpg


上网测速结果如下:
Open https://www.speedtest.cn/ on the PC to test speed. The test results are as follows:


http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_33.jpg
http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_33.jpg


'''''注意:网络测速受网络环境和测试方法影响,速度请以实际为准,本测试仅供参考。'''''
'''''Note: The speed test can be affected by the network environment and the testing method. Speeds should be considered based on actual results; this test is for reference only.'''''


=== 6.6 SSD硬盘测试 ===
=== 6.6 SSD test ===
MPS2.5G扩展板在OpenWrt系统下,默认树莓派上的原生千兆网口为LAN口,我们可以把扩展板上的2.5G网口作为LAN口,而把树莓派5上的原生网口作为WAN口,这样就能利用2.5G网口在内网高速传输文件。
Under the OpenWrt system, the MPS2.5G expansion board defaults to the native Gigabit Ethernet port on the Raspberry Pi as the LAN port. We can set the 2.5G Ethernet port on the expansion board as LAN port and use the native Ethernet port on the Raspberry Pi 5 as the WAN port. So we can leverage the 2.5G port for high-speed file transfer within the local network.


交换LAN口,然后进行SSD硬盘测试,请参照下面的文档:
Switch the LAN port, and then proceed with the SSD disk testing. Please refer to the following document:


[[0015 MP2.5G(单2.5G以太网)#6.3 MP2.5D的2.5G网口的配置和应用|MP2.5D的2.5G网口的配置和应用]]
[[0015 MP2.5G(单2.5G以太网)#6.3 MP2.5D的2.5G网口的配置和应用|MP2.5D的2.5G网口的配置和应用]]

2024年10月16日 (三) 17:00的版本

Keywords

Raspberry Pi 5, PCIe Expansion, 2.5G, NVMe, M.2, SSD, X1 Gen2

I. Introduction

The Raspberry Pi 5 is equipped with a 16-pin PCIe interface, through which we can attach various PCIe devices. This expansion board is specifically designed for the Raspberry Pi 5, offering 2.5G networking and NVMe SSD storage. The expansion board is plug-and-play in the Raspberry Pi system, but the 2.5G network adapter requires driver installation in Ubuntu system.

Note:

1. The latest firmware for the Raspberry Pi now supports booting from an SSD connected to the rear of the PCIe Switch. The SSD can be used for storage expansion and system booting.

2. Since the PCIe Switch is x1 Gen2, changing the mode to Gen3 in config.txt will not increase the interface speed; therefore, the SSD interface speed test will be limited to around 400MB/s, which is slightly faster than CM4.

II. Hardware Spec

1. Based on the PCIe interface of the Raspberry Pi 5, a PCIe Switch is used to expand one port into two, providing one NVMe SSD port and one 2.5G Ethernet port.

2. 2.5Gbps Ethernet based on the RTL8125 chip (if the workload on the 2.5G Ethernet port is high, it is recommended to add a heatsink to the onboard chip).

3. Supports NVMe SSD of 2230/2242/2280 sizes (default comes with welded 2280 copper pillars); does not support SATA and NGFF SSD. The SSD can be used for expanded storage and also supports booting from the SSD (requires the Raspberry Pi official firmware to be at least updated to 2024.5.13). Note: After firmware updates, do not modify the settings, as doing so will automatically revert the firmware to the previous version.

4. The RTL8125 2.5G Ethernet adapter is driver-free in the official Raspberry Pi OS and OpenWrt systems, but requires driver installation in Ubuntu systems.

5. Gold immersion PCB process, lead-free production, certified by UL, compliant with ROHS standards, and has a fire rating of 94V-0.

6. The board has four M2.5 mounting holes, with a recessed design on the top of the board to facilitate the use of the 40-Pin GPIO.

0008_MPS2_5G_38.jpg

三、系统烧写及设置

3.1 概述

This document uses the Raspberry Pi OS, Ubuntu system and OpenWrt system for testing.

1)The version of the Raspberry Pi OS is: 2024-07-04-raspios-bookworm-arm64.img.xz

You can download the Raspberry Pi OS in:

https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-64-bit

2)The version of the Ubuntu system is: ubuntu-24.04-preinstalled-desktop-arm64+raspi.img.xz

You can download the Ubuntu system in:

https://ubuntu.com/download/raspberry-pi

3)The version of the OpenWrt system is: openwrt-bcm27xx-bcm2712-rpi-5-squashfs-sysupgrade-linux-6.1.100-20240805.img.gz

3.2 System flashed onto the SD (TF) card

Click here to read the instructions for System flashing

3.3 System flashed onto the SSD

Click here to read the instructions for System flashing

IV. Work with Raspberry Pi OS

4.1 2.5G Ethernet test

The 2.5G Ethernet port on the MPS2.5G expansion board is plug-and-play under Raspberry Pi OS and can obtain an IP address once the system is up and running:

0008_MPS2_5G_02.jpg

You can also enter ifconfig -a in the terminal to view the network status:

0008_MPS2_5G_03.jpg

Install the network speed testing tool iperf3:

sudo apt install iperf3

0008_MPS2_5G_04.jpg

Use iperf3 to perform a speed test between the Raspberry Pi OS and the PC.

When Raspberry Pi OS acts as a client, the speed is about 2.25 Gbps:

0008_MPS2_5G_05.jpg

When Raspberry Pi OS acts as a server, the speed is about 1.68 Gbps:

0008_MPS2_5G_06.jpg

Note: Network speed tests are affected by network conditions and testing methods. The actual speed may vary; this test is for reference only.

4.2 Fix the MAC address of the 2.5G Ethernet port

The 2.5G Ethernet port uses the RTL8125 network card, and during use, the MAC address is not fixed. Each time the device is powered on again, the MAC address changes randomly. The following explains how to set a fixed MAC address for the RTL8125 network card.

This explanation also applies to the Ubuntu system.

First, check the identification information of the RTL8125 network card in terminal:

ipconfig -a

0015_MP2_5G_28.jpg

Here, the RTL8125 network card is identified as eth1, but in practice, the name recognized by the system might be different.

Then input:

sudo mousepad /etc/systemd/system/macspoof@eth1.service

Or:

sudo nano /etc/systemd/system/macspoof@eth1.service

eth1 is the name recognized by the system for the network card shown above.

Executing the above command will create a new document, then enter the following text:

[Unit]

Description=MAC Address Change %I

Wants=network-pre.target

Before=network-pre.target

BindsTo=sys-subsystem-net-devices-%i.device

After=sys-subsystem-net-devices-%i.device

[Service]

Type=oneshot

ExecStart=/usr/bin/ip link set dev %i address xx:xx:xx:xx:xx:xx

ExecStart=/usr/bin/ip link set dev %i up

[Install]

WantedBy=multi-user.target

Here, "xx:xx:xx:xx:xx:xx" represents the MAC address you wish to assign. You can determine it according to the MAC address format (make sure it does not duplicate the MAC address of other network devices). After setting it, save and exit.

Then execute the following command to enable the service:

sudo systemctl enable macspoof@eth1.service

This completes the fixation of the MAC address for eth1.

After completing all operations, restart the system. Once the system has finished rebooting, execute ipconfig -a to see that the MAC address has been successfully changed.

0015_MP2_5G_29.jpg

4.3 SSD test

For basic operations on the SSD drive, we can refer to the following link:

1. Use the SSD for storage expansion(Raspberry Pi OS)

2. Perform partitioning and other operations on the SSD

3. Adjust the boot devices order

4. Install the SSD speed testing software hdparm

Since the MPS2.5G cannot operate in PCIe Gen3 mode, we do not need to change the PCIe mode and can directly use the hdparm to test the speed.

Run df in the Raspberry Pi terminal to check the partition name of the SSD, which is nvme0n1p1:

0008_MPS2_5G_07.jpg

Excute the command; it can be executed multiple times to test the disk speed repeatedly:

sudo hdparm -t /dev/nvme0n1p1

0008_MPS2_5G_08.jpg

The test shows that the operating speed of this disk is about 395 MBps.

Note: The disk operation speed is affected by various factors including the quality of the disk and the file storage situation on the disk. The above test results are for reference only and do not represent the final parameters of the actual product.

V. Work with Ubuntu System

5.1 2.5G Ethernet test

In Ubuntu system, the 2.5G network card driver needs to be installed to use the device.

First, you need to update the system:

sudo apt-get update

0008_MPS2_5G_09.jpg

Next, prepare the compilation environment:

sudo apt-get install --reinstall linux-headers-$(uname -r) linux-headers-generic build-essential dkms

0008_MPS2_5G_10.jpg

Then install the driver:

sudo apt-get install r8125-dkms

0008_MPS2_5G_11.jpg

After installation is complete, excute:

sudo modprobe r8125

0008_MPS2_5G_12.jpg

Ubuntu系统默认不安装ifconfig工具,所以需要手动安装:

sudo apt install net-tools

0008_MPS2_5G_13.jpg

Enter ifconfig -a to see the network interface called enxxx, which indicates that the 2.5G network card driver has been successfully installed:

0008_MPS2_5G_14.jpg

Use iperf3 to perform a speed test between the Ubuntu system and the PC.

When Ubuntu system acts as a client, the speed is about 2.26 Gbps:

0008_MPS2_5G_15.jpg

When Ubuntu system acts as a server, the speed is about 1.70 Gbps:

0008_MPS2_5G_16.jpg

Note: Network speed tests are affected by network conditions and testing methods. The actual speed may vary; this test is for reference only.

5.2 SSD test

For basic operations on the SSD drive, we can refer to the following link. Only the SSD being used as storage expansion having slightly different operations under the Raspberry Pi OS, the rest of the processes are largely the same.

1. Use the SSD for storage expansion(Ubuntu system)

2. Perform partitioning and other operations on the SSD

3. Adjust the boot devices order

4. Install the SSD speed testing software hdparm

Since the MPS2.5G cannot operate in PCIe Gen3 mode, we do not need to change the PCIe mode and can directly use the hdparm to test the speed.

Run df in the terminal to check the partitions' name of the SSD, which are nvme0n1p1 and nvme0n1p2:

0008_MPS2_5G_17.jpg

We select one to perform a speed test:

sudo hdparm -t /dev/nvme0n1p1

Excute the command; it can be executed multiple times to test the disk speed repeatedly:

0008_MPS2_5G_18.jpg

The test shows that the operating speed of this disk is about 430 MBps.

Note: The disk operation speed is affected by various factors including the quality of the disk and the file storage situation on the disk. The above test results are for reference only and do not represent the final parameters of the actual product.

VI. Work with OpenWrt System

6.1 Overview

The MPS2.5G expansion board can be configured as a two-in-two-out switch mode under the OpenWrt system. The 2.5G Ethernet port on the expansion board can be used as the WAN port (connected to the Internet), or the built-in WiFi on the Raspberry Pi 5 can be used as the WAN port (connected to the Internet). The Ethernet port on the Raspberry Pi 5 is configured as a LAN port for connecting to a PC, or the built-in WiFi on the Raspberry Pi 5 can be used as a wireless AP to connect devices such as smartphones.

6.2 Preparation

After flashing the OpenWrt system and powering it up, we connect an Ethernet cable from the Raspberry Pi 5's built-in Ethernet port to the PC's Ethernet port, connect the Ethernet cable from the router to the 2.5G Ethernet port on the expansion board.Once the connection between the PC's network card and the Raspberry Pi's Ethernet port is successful, we find Network and Internet settings in Windows, then open the connected network under Ethernet to view the default gateway IP address. This address is the backend configuration page address for the OpenWrt system. As shown in the figure, the address for this test is 192.168.198.1:

2001_CM4_Ultra_53.jpg

Then open a web browser and enter 192.168.198.1 to access the OpenWrt system. The default username is root, and the default password is password:

2001_CM4_Ultra_54.jpg

6.3 PC accesses the internet through the 2.5G Ethernet port.

Open "Network - Interfaces", and click "Add new interface":

0008_MPS2_5G_19.jpg

Set "Name of the new interface" as WAN, choose "DHCP client" for "Protocol of the new interface," select "eth1" for "Cover the following interface," and then click the "SUBMIT" button:

0008_MPS2_5G_20.jpg

In the "Firewall Settings", select the WAN and then click the "SAVE & APPLY" button:

0008_MPS2_5G_21.jpg

Go back to "Network - Interfaces", wait a moment, and you will see the newly created WAN interface has obtained an IP address. This way, the PC can access the internet through the MPS2.5G expansion board:

0008_MPS2_5G_22.jpg

Open https://www.speedtest.cn/ on the PC to test speed. The test results are as follows:

0008_MPS2_5G_23.jpg

Note: The speed test can be affected by the network environment and the testing method. Speeds should be considered based on actual results; this test is for reference only.

6.4 Use the Raspberry Pi's built-in WiFi as a wireless AP (in master mode)

By default, the wireless module included with the Raspberry Pi 5 is already configured as a wireless AP, which we can see under "Network - Wireless":

0008_MPS2_5G_24.jpg

Click "Edit", and under "Interface Configuration - Basic Settings", you can see the SSID of this AP:

0008_MPS2_5G_25.jpg

We can use a smartphone to search for this AP, and after connecting to it, we can access the internet (the smartphone connects to the AP created by the Raspberry Pi 5's native wireless network card, the 2.5G Ethernet port acts as the WAN port connected to the upstream router, and the native Gigabit Ethernet port acts as the LAN port connected to the PC):

0008_MPS2_5G_26.jpg

6.5 Use the Raspberry Pi's built-in WiFi as a Client

This section mainly describes how to use the Raspberry Pi's built-in WiFi as a client, meaning the Raspberry Pi connects to an upstream router via WiFi.

View the wireless profile under "Network - Wireless":

0008_MPS2_5G_27.jpg

Click the "Scan" button to scan for nearby wireless APs:

0008_MPS2_5G_28.jpg

Select one to connect, and choose WAN for the firewall:

0008_MPS2_5G_29.jpg

Then click "SUBMIT", and after submitting, click "SAVE & APPLY":

0008_MPS2_5G_30.jpg

After succeeding, go back to "Wireless Overview", and you will see that the wireless connection has been established successfully:0008_MPS2_5G_31.jpg

Go back to "Network - Interfaces", and you can see that the newly created WAN interface has obtained an IP address. The PC can connect to the internet through the wireless module and the upstream router:

0008_MPS2_5G_32.jpg

Open https://www.speedtest.cn/ on the PC to test speed. The test results are as follows:

0008_MPS2_5G_33.jpg

Note: The speed test can be affected by the network environment and the testing method. Speeds should be considered based on actual results; this test is for reference only.

6.6 SSD test

Under the OpenWrt system, the MPS2.5G expansion board defaults to the native Gigabit Ethernet port on the Raspberry Pi as the LAN port. We can set the 2.5G Ethernet port on the expansion board as LAN port and use the native Ethernet port on the Raspberry Pi 5 as the WAN port. So we can leverage the 2.5G port for high-speed file transfer within the local network.

Switch the LAN port, and then proceed with the SSD disk testing. Please refer to the following document:

MP2.5D的2.5G网口的配置和应用

双SSD硬盘存储测试

联系我们

4f7e81daf8791971.jpg 79c020da7ad0af9b.jpg 2851e01a0549e6f7.gif 0003_bb.jpg 0005_qq.jpg QQ:8204136

邮件:mcuzone@vip.qq.com

电话:13957118045

如本页面有任何疏漏、错误或者侵权,请通过上述途径联系我们,谢谢!

Copyright 2004-2024 野芯科技