0008 MPS2.5G(SSD and 2.5G ETH):修订间差异
(未显示2个用户的9个中间版本) | |||
第9行: | 第9行: | ||
Note: | Note: | ||
1. | 1. Currently, the Raspberry Pi firmware (version 2024.5.13 and later) 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. | 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. | ||
第67行: | 第67行: | ||
You can also enter <code>ifconfig -a</code> in the terminal to view the network status: | You can also enter <code>ifconfig -a</code> in the terminal to view the network status: | ||
http://www.mcuzone.com/wiki/0008_MPS2_5G/ | http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_41.jpg | ||
Install the network speed testing tool iperf3: | Install the network speed testing tool iperf3: | ||
第117行: | 第117行: | ||
'''''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.''''' | '''''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''' == | == '''V. Work with Ubuntu OS''' == | ||
=== 5.1 2.5G Ethernet test === | === 5.1 2.5G Ethernet test === | ||
第167行: | 第167行: | ||
'''''Note: Network speed tests are affected by network conditions and testing methods. The actual speed may vary; this test is for reference only.''''' | '''''Note: Network speed tests are affected by network conditions and testing methods. The actual speed may vary; this test is for reference only.''''' | ||
Under the Ubuntu system, the method for setting the MAC address of the 2.5G Ethernet port is the same as under the Raspberry Pi OS; please refer to [[0008 MPS2.5G(SSD and 2.5G ETH)#4.2 Set MAC address|Section 4.2]]. | |||
=== 5.2 SSD test === | === 5.2 SSD test === | ||
第202行: | 第204行: | ||
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. | 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 Login OpenWrt === | ||
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. | 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 as LAN, connect the Ethernet cable from the router to the 2.5G Ethernet port on the expansion board as WAN. Then we find Network and Internet settings in Windows, and 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: | ||
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 | ||
第211行: | 第213行: | ||
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 | === 6.3 Set the 2.5G port as the WAN port === | ||
Open "Network - Interfaces", and click "Add new interface": | Open "Network - Interfaces", and click "Add new interface": | ||
第234行: | 第236行: | ||
'''''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.''''' | '''''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 | === 6.4 Use 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": | 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": | ||
第247行: | 第249行: | ||
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 Use | === 6.5 Use 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. | 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. | ||
2024年11月6日 (三) 17:07的最新版本
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. Currently, the Raspberry Pi firmware (version 2024.5.13 and later) 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.
7.size:85*56mm.
III. Software Spec
3.1 Overview
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:
You can also enter ifconfig -a
in the terminal to view the network status:
Install the network speed testing tool iperf3:
sudo apt install iperf3
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:
When Raspberry Pi OS acts as a server, the speed is about 1.68 Gbps:
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 Set MAC address
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
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.
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:
Excute the command; it can be executed multiple times to test the disk speed repeatedly:
sudo hdparm -t /dev/nvme0n1p1
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 OS
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
Next, prepare the compilation environment:
sudo apt-get install --reinstall linux-headers-$(uname -r) linux-headers-generic build-essential dkms
Then install the driver:
sudo apt-get install r8125-dkms
After installation is complete, excute:
sudo modprobe r8125
The ifconfig tool is not installed by default in Ubuntu system, so it needs to be installed manually:
sudo apt install net-tools
Enter ifconfig -a
to see the network interface called enxxx, which indicates that the 2.5G network card driver has been successfully installed:
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:
When Ubuntu system acts as a server, the speed is about 1.70 Gbps:
Note: Network speed tests are affected by network conditions and testing methods. The actual speed may vary; this test is for reference only.
Under the Ubuntu system, the method for setting the MAC address of the 2.5G Ethernet port is the same as under the Raspberry Pi OS; please refer to Section 4.2.
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:
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:
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
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 Login OpenWrt
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 as LAN, connect the Ethernet cable from the router to the 2.5G Ethernet port on the expansion board as WAN. Then we find Network and Internet settings in Windows, and 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:
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
:
6.3 Set the 2.5G port as the WAN port
Open "Network - Interfaces", and click "Add new interface":
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:
In the "Firewall Settings", select the WAN and then click the "SAVE & APPLY" button:
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:
Open https://www.speedtest.cn/ on the PC to test speed. The test results are as follows:
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 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":
Click "Edit", and under "Interface Configuration - Basic Settings", you can see the SSID of this AP:
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):
6.5 Use 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":
Click the "Scan" button to scan for nearby wireless APs:
Select one to connect, and choose WAN for the firewall:
Then click "SUBMIT", and after submitting, click "SAVE & APPLY":
After succeeding, go back to "Wireless Overview", and you will see that the wireless connection has been established successfully:
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:
Open https://www.speedtest.cn/ on the PC to test speed. The test results are as follows:
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:
Configuration and Application of the 2.5G Ethernet Port on the MP2.5G
Contact Us
Email: mcuzone@vip.qq.com
Tel: +86(0)13957118045
If there are any omissions, errors, or infringements on this page, please contact us through the above methods. Thank you!
Copyright 2004-2024 Wildchip