From Waveshare Wiki
Jump to: navigation, search

With three USB3.2 and two Gigabit Ethernet ports, for all Variants of CM4






CM4-DUAL-ETH-BASE is a base board that can be used with Raspberry Pi Compute Module 4, and supports 7~12V DC power supply, onboard three USB3.2, dual Gigabit Ethernet ports and it is suitable for scenarios that require multiple network ports, such as soft routing.

Precautions for use

1: Do not plug and unplug any device except USB and HDMI when powered on.
2: Confirm the fan voltage before connecting, support 5V and 12V, connect 12V by default, please modify the resistance of FAN_VCC when switching.
3: The Type C interface is only used as the USB SLAVE interface to program the image, and cannot be used as a power supply.
4: In order to ensure the normal power supply of CM4, please do not connect other devices when using the Type C interface to burn the image.
5: When CM4 is in normal use, it needs to provide at least 12V 1.5A power supply. Otherwise, there may be problems such as automatic shutdown, frequency reduction and so on.
6: For Opwenwrt, see the instructions for use.
7: This expansion board does not support POE function.


Version: CM4-DUAL-ETH-BASE V3 (20220527)

  • 1: Add common mode inductance to improve EMI. (CE certified)

Version: CM4-DUAL-ETH-BASE V2 (20220518)

  • 1: DSI interface changed from DSI0 to DSI1
  • 2: Correct the mismatch between screen printing and network in RTC SYSTEM and other parts


  • Initial version


Compute_Module 4
Compute Module 4 IO Board 5.png

What's on Board


No. Component Description
1 CM4 socket Suitable for all variants of Compute Module 4
2 40PIN GPIO Connect HAT module
3 Gigabit Ethernet connector Dual RJ45 Gigabit Ethernet ports, support 10/100/1000M network access
ETHERNET 0: CM4 native network port
ETHERNET 1: USB extended network port
4 USB 3.2 3x USB 3.2 Gen1 interface, support various USB device insertion
5 HDMI Dual HDMI ports, support dual 4K 30fps output
6 CAM Dual MIPI CSI camera interface
7 DC Power 7~36V DC wide voltage power supply
8 Dual LED Red light: Raspberry Pi power indicator
Green light: Raspberry Pi working status indicator
9 Micro SD Used to connect the Micro SD card with the system to start Compute Module 4 Lite
10 FAN Convenient access to cooling fans, support speed regulation and speed measurement
11 DISP MIPI DSI Display interface - DISP1
12 USB SLAVE Compute Module 4 eMMC Version can burn the system image through this interface
13 RTC Battery connector Can be connected to CR1220 button battery
14 RTC Interrupt pin switching PI-RUN: RTC trigger interrupt CM4 restart
GN-EN: RTC trigger interrupt CM4 power off
D4: RTC trigger interrupt D4 pin
15 IO-VREF selection CM4 IO logic voltage switch 3.3V or 1.8V
16 FAN power supply options can choose 5V or 12V voltage to drive the fan
17 System function switch BT_DIS: Bluetooth disabled, only for CM4 version with antenna
WiFi_DIS: WiFi disabled, only for CM4 version with antenna
WP_DIS: Start mode switch, only For use without EMMC boot or SD boot
18 RTC/FAN I2C bus selection SDA0/SCL0: I2C-10 and CSI/DSI shared
GPIO3/2: I2C-1 and 40PIN shared
19 RTL8153 USB Gigabit LAN Chip
20 EMC2301 Fan controller, control fan speed, measure fan speed
21 VL805 USB 3.0 HUB


Do not plug or unplug any device while it is powered on.

Writing Image


Fan voltage switching

As shown in the figure, the FAN voltage is switched according to the position of the resistor, and the default is 12V.

  • Note: Please connect the fan before turning on the power of the base board and then complete the test. Please do not connect the fan after the base board is powered on, because the fan control chip has been powered on, otherwise the chip will be burned!
  • Note: Before connecting, please confirm whether the rated voltage of the fan is consistent with the voltage actually connected to the fan.

Please note that DSI and CSI are prohibited when using RTC.
I2C-10 is used by default

RTC (PCF85063a) on i2c-10, address is 0x51 (7-bit address)
FAN ( EMC2301 ) on i2c-10, address is 0x2f (7-bit address)

If you need to add it to your program instead of the kernel, you can refer to the C and Python demo reference click here


sudo nano /boot/config.txt
 #Add the following lines at the end
 #Add # in front of dtparam=audio=on
 #Save and exit, restart
 sudo reboot

How to use Hwclock

Synchronize system clock to hardware clock.

sudo hwclock -w

Synchronize hardware clock to system clock.

sudo hwclock -s
 #The network or the NTP needs to be closed, otherwise it will be changed back.

Set the hardware clock time:

sudo hwclock --set --date="9/8/2021 16:45:05"

View hardware clock.

sudo hwclock -r

Display version information.

sudo hwclock --verbose


When powered on, the fan will spin for 1 second, then stop for 2 seconds, and then spin again, this is a normal phenomenon
There is no official configuration method for the fan currently, there is a third-party configuration method:
This method is published by a third party, and we are not responsible for any problems!

sudo apt-get install dkms 
mkdir -p ~/src
cd ~/src
git clone
cd cm4io-fan
sudo chmod 777
sudo  ./

#If an error message appears: Your kernel headers for kernel 5.XX.XX-v7l+ cannot be found at
#After rebooting the device, you can execute it

#The following is the description of config.txt
Name:   cm4io-fan
Info:   Raspberry Pi Compute Module 4 IO Board fan controller
Load:   dtoverlay=cm4io-fan,<param>[=<val>]
Params: minrpm             RPM target for the fan when the SoC is below 
                            mintemp (default 3500)
        maxrpm              RPM target for the fan when the SoC is above
                            maxtemp (default 5500)
        midtemp             Temperature (in millicelcius) at which the fan
                            begins to speed up (default 50000)
        midtemp_hyst        Temperature delta (in millicelcius) below mintemp
                            at which the fan will drop to minrpm (default 2000)
        maxtemp             Temperature (in millicelcius) at which the fan 
                            will be held at maxrpm (default 70000)
        maxtemp_hyst        Temperature delta (in millicelcius) below maxtemp
                            at which the fan begins to slow down (default 2000)

Or directly refer to the following:


The fan will start to accelerate when the temperature is higher than 45 degrees Celsius, and will up to the highest speed when higher than 50 degrees Celsius.


Configuration file

CSI and DSI are disabled by default. When using the camera and DSI, it will occupy three I2C devices: I2C-10, I2C-11, and I2C-0.

  • Open a terminal and run the following commands:
sudo apt-get install p7zip-full -y
7z x CM4_dt_blob.7z -O./CM4_dt_blob
sudo chmod 777 -R CM4_dt_blob
cd CM4_dt_blob/
# If using two cameras and DSI1 execute
sudo dtc -I dts -O dtb -o /boot/dt-blob.bin dt-blob-disp1-double_cam.dts
# In the use of any DSI, HDMI1 no image output, even if you do not connect the DSI screen as long as the corresponding file compiled, that HDMI1 no output
# If you need to restore, delete the corresponding dt-blob.bin can be: sudo rm -rf /boot/dt-blob.bin 
#Execution is complete, power off and restart CM4

New Version (Bullseye)

Camera Config

  1. Execute the following commands to edit "/boot/config.txt" file.
    sudo nano /boot/config.txt
  2. Block or remove the automatic camera detection statement:
  3. Add the driver of the camera you are using, here I take IMX219 as an example and connect it to CAM0, and attach the adapter.
    Model CAM0 Set Sentence CAM1 Set Sentence
    OV9281 dtoverlay=ov9281,cam0 dtoverlay=ov9281,cam1
    IMX290/IMX327 dtoverlay=imx290,clock-frequency=37125000,cam0 dtoverlay=imx290,clock-frequency=37125000,cam1
    IMX378 dtoverlay=imx378,cam0 dtoverlay=imx378,cam1
    IMX219 dtoverlay=imx219,cam0 dtoverlay=imx219,cam1
    IMX477 dtoverlay=imx477,cam0 dtoverlay=imx477,cam1
    IMX708 dtoverlay=imx708,cam0 dtoverlay=imx708,cam1
    • If you are using the official Raspberry Pi camera and only one camera is connected, there is no need to set the config file. If it is not an official camera, set the "dtoverlay" statement without the "cam" suffix.
    • CM4-NANO - only CAM0 is used, so you only need to add "dtoverlay=imx219,cam0".
    4. Press Ctrl+o to save the file and then press Enter. CM4-NANO-B004.png
    5. Ctrl+x to exit the editor.
    6. Reboot the Raspberry Pi.
    sudo reboot

Camera Test

  1. Enter the camera detection command, you can see that the camera is detected by now.
    libcamera-hello --list-cameras


  2. Display the camera screen on the desktop.
  3. libcamera-hello -t
  4. Taking photos.
    libcamera-jpeg -o test.jpg
  5. Record a video of 10s.
    libcamera-vid -t 10000 -o test.h264
  6. Other Commands
    Check whether the camera is detected:
    libcamera-hello --list-cameras

    Open the corresponding cameras:

    libcamera-hello  --camera 1
    libcamera-hello  --camera 0

    Take a photo:

    libcamera-jpeg -o test.jpg
    #Add --camera to specify a camera 

Old Version (Buster)

Camera Config

    1. Execute the following command to enter the Raspberry Pi configuration.
    sudo raspi-config

    2. Choose Interfacing Options and enter.
    3. Choose Camera:
    4. Choose to enable the camera interface.
    5. The system prompts as follows:
    6. Back to the main interface, select Finish.
    7. Reboot the system.

    Camera Test

    raspistill -o image.jpg
    • Test the recording function:
    raspivid -o video.h264 -t 10000
      • Where -t 10000 means recording for 10 seconds, users can adjust according to their own needs.
      • Please refer to CSI.



Openwrt has high customization and scalable performance. Openwrt is becoming more and more popular at present. Compared with commonly used wireless routers, openwrt's modifiable firmware allows us to customize router functions according to our own needs, such as single-arm routing, automatic Define routing policies, qos, intranet penetration, etc. Note: We do not provide any technical support for Openwrt system if there has any problem during use, only provide he following tutorials and images, and no other technical support other than hardware is provided.


The openwrt image configured above supports CM4 onboard wifi and the driver of RTL8153. CM4 can be turned into a smart router,
The following will tell you how to install Openwrt on the Raspberry Pi to realize the function of a wireless router, so that the devices in the LAN can access the Internet through the wireless router, and realize the intelligent management of the LAN. The overall network topology is as follows
After booting correctly, log in to the system:
The computer is connected to the ETH0 interface, and then directly ssh remote login or web page login
The configured system default IP is:
The default IP of the system without configuration is:
Account: root without password

If you think the network port is not enough, you can buy it USB 3.2 Gen1 TO Gigabit ETH RTL8153 expansion network port, if there is one ETH/USB HUB AT RTL8152 can also expand the 100M Ethernet port and support it.



Demo codes

3D Drawing




a) Check if dtparam -audio -on is blocked in /boot/config.txt.
b) Check if the /boot/dt-blob.bin file exists, if it does, please delete it.



Technical Support

If you need technical support or have any feedback/review, please click the Submit Now button to submit a ticket, Our support team will check and reply to you within 1 to 2 working days. Please be patient as we make every effort to help you to resolve the issue.
Working Time: 9 AM - 6 AM GMT+8 (Monday to Friday)