Difference between revisions of "CM4-POE-UPS-BASE"

From Waveshare Wiki
Jump to: navigation, search
 
(40 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
<div class="wiki-pages jet-green-color">
 
{{Infobox item
 
{{Infobox item
 
|name=CM4-POE-UPS-BASE
 
|name=CM4-POE-UPS-BASE
|img=[[File:CM4-POE-UPS-BASE.png|300px|alt=CM4-POE-UPS-BASE|link=https://www.waveshare.com/cm4-poe-ups-base-en.htm |CM4-POE-UPS-BASE]]
+
|img=[[File:CM4-POE-UPS-BASE.png|300px|alt=CM4-POE-UPS-BASE|{{Amazon_nolink|default={{#ifeq: {{#urlget:amazon|0}}|{{#urlget:Amazon|0}}| default|}}|url=link=https://www.waveshare.com/cm4-poe-ups-base-en.htm}} |CM4-POE-UPS-BASE]]
 
|category=[[:Raspberry Pi|Raspberry Pi]]
 
|category=[[:Raspberry Pi|Raspberry Pi]]
 
|brand=Waveshare
 
|brand=Waveshare
Line 16: Line 17:
 
|interface11 = FAN
 
|interface11 = FAN
 
}}
 
}}
= Overview =
+
=Introduction=
==Introduction==
+
This product is an IO board of the 4th generation of Raspberry Pi Compute Module. Compute Module 4 POE Board is a baseboard that can be used with Raspberry Pi Compute Module 4, supports POE power supply and 7~36V DC power supply with four onboard USB2 .0, which is for the user's convenience.
I am an IO board of the 4th generation of Raspberry Pi Compute Module. Compute Module 4 POE Board is a baseboard that can be used with Raspberry Pi Compute Module 4, and supports POE power supply and 7~36V DC power supply, with four onboard USB2 .0 for user convenience.
+
*Before using the fan, the case needs to be assembled and the screws are fixed.
 
 
 
==Users Guides==
 
==Users Guides==
1: Confirm the fan voltage before connecting, it support 5V and 12V. if you want to connect 12V by default, please modify the jumper cap of FAN_VCC<br />
+
1: Confirm the fan voltage before connecting, it supports 5V and 12V. if you want to connect 12V by default, please modify the jumper cap of FAN_VCC.<br />
2: USB Type C interface is used as the USB SLAVE interface to burn the image, and it can also be used as the power supply interface, but cannot be used as the OTG interface.<br />
+
2: The USB Type C interface is used as the USB SLAVE interface to burn the image, and it can also be used as the power supply interface, but cannot be used as the OTG interface.<br />
3: The BOOT switch is for CM4 startup mode, the ON for CM4 to enter the programming mode, and the OFF for system to starts normally.<br />
+
3: The BOOT switch is for CM4 startup mode, the ON for CM4 to enter the programming mode, and the OFF for the system to start normally.<br />
4: In normal use, it is necessary to provide at least 5V 1.5A power supply for CM4. Otherwise, there may be problems such as automatic shutdown, frequency reduction and so on.<br />
+
4: In normal use, it is necessary to provide at least a 5V/1.5A power supply for CM4. Otherwise, there may be problems such as automatic shutdown, frequency reduction, and so on.<br />
5: USB2.0 is closed by default, if you want to open it, you need to add dtoverlay=dwc2,dr_mode=host in config.txt<br />
+
5: <font color="#FF0000">USB2.0 is closed by default, if you want to open it, you need to add dtoverlay=dwc2,dr_mode=host in config.txt.</font><br />
 
6: When using the POE function, pay attention to check whether the switch supports PoE of the 802.3af network standard.<br />
 
6: When using the POE function, pay attention to check whether the switch supports PoE of the 802.3af network standard.<br />
 
7: When you need to use POE, connect the POE jumper cap to the EN position.<br />
 
7: When you need to use POE, connect the POE jumper cap to the EN position.<br />
 
8: The Change LED light is the charging indicator, it is always on when charging, goes off when fully charged, and flashes when it fails.<br />
 
8: The Change LED light is the charging indicator, it is always on when charging, goes off when fully charged, and flashes when it fails.<br />
==Note==  
+
 
Note 1: When assembling, you need to turn the power switch to the OFF first, disconnect the power supply and then assemble, otherwise the operation will easily cause a short circuit to burn the device.<br />
+
==<font color="#FF0000">Note==  
 +
Note 1: When assembling, you need to turn the power switch to OFF first, disconnect the power supply and then assemble, otherwise the operation will easily cause a short circuit to burn the device.<br />
 
Note 2: When connecting the battery for the first time, you need to pay attention to whether the WARNING LED is on. If the LED is on, it means that the corresponding battery is connected in reverse. Do not charge if the battery is reversed.<br />
 
Note 2: When connecting the battery for the first time, you need to pay attention to whether the WARNING LED is on. If the LED is on, it means that the corresponding battery is connected in reverse. Do not charge if the battery is reversed.<br />
 
Note 3: When the battery is connected for the first time, there may be no power output. You need to press the BOOT activation button or charge the battery to activate the battery protection chip to have power output. The power switch needs to be turned to ON.<br />
 
Note 3: When the battery is connected for the first time, there may be no power output. You need to press the BOOT activation button or charge the battery to activate the battery protection chip to have power output. The power switch needs to be turned to ON.<br />
 
Note 4: It is forbidden to plug and unplug any device except USB and HDMI while the power is on.<br />
 
Note 4: It is forbidden to plug and unplug any device except USB and HDMI while the power is on.<br />
Note 5: It is recommended not to exceed 4A when working with high current for a long time. When working for a long time at 4A, it will heat up. Pay attention to heat dissipation.<br />
+
Note 5: It is recommended not to exceed 4A when working with a high current for a long time. When working for a long time at 4A, it will heat up. Pay attention to heat dissipation.<br />
 
Note 6: The external power supply must be greater than the power consumption of the entire system, otherwise there will not be enough current to charge the battery for a long time, and the battery power will become lower and lower until it is turned off.<br />
 
Note 6: The external power supply must be greater than the power consumption of the entire system, otherwise there will not be enough current to charge the battery for a long time, and the battery power will become lower and lower until it is turned off.<br />
 
Note 7: When the system load is heavy and the battery voltage is low, there may be a situation where the battery current is insufficient and the system keeps restarting. <br />
 
Note 7: When the system load is heavy and the battery voltage is low, there may be a situation where the battery current is insufficient and the system keeps restarting. <br />
 
Note 8: If the positive insulating pad of the battery is broken, it is recommended not to continue to use it, which may cause a short circuit and fire. When removing the battery, do not use a screwdriver to pry the positive electrode of the battery, which may cause a short circuit. It is recommended to pry the negative electrode of the battery.<br />
 
Note 8: If the positive insulating pad of the battery is broken, it is recommended not to continue to use it, which may cause a short circuit and fire. When removing the battery, do not use a screwdriver to pry the positive electrode of the battery, which may cause a short circuit. It is recommended to pry the negative electrode of the battery.<br />
 
===Precautions for the use of lithium batteries===
 
===Precautions for the use of lithium batteries===
*Li-polymer and Li-ion batteries are very unstable. Improper charging or use may result in fire, personal injury and property damage.
+
*Li-polymer and Li-ion batteries are very unstable. Improper charging or use may result in fire, personal injury, and property damage.
 
*Do not connect the wrong polarity when charging and discharging the battery pack. Do not use other inferior chargers or charging boards to charge the lithium battery.
 
*Do not connect the wrong polarity when charging and discharging the battery pack. Do not use other inferior chargers or charging boards to charge the lithium battery.
 
*Do not mix and use old and new batteries, and avoid using batteries of other brands.
 
*Do not mix and use old and new batteries, and avoid using batteries of other brands.
Line 45: Line 46:
 
*Lithium batteries have a cycle life, please replace the old battery with a new one when it reaches its useful life or when it has been used for two years (whichever comes first).
 
*Lithium batteries have a cycle life, please replace the old battery with a new one when it reaches its useful life or when it has been used for two years (whichever comes first).
 
*Please place battery products properly, keep away from flammable and explosive items, keep away from children, and avoid safety accidents caused by careless storage.
 
*Please place battery products properly, keep away from flammable and explosive items, keep away from children, and avoid safety accidents caused by careless storage.
 +
</font>
  
 
==Demension==
 
==Demension==
Line 52: Line 54:
 
[[File:de2.png]]<br />
 
[[File:de2.png]]<br />
 
==Onboard Introduction==
 
==Onboard Introduction==
[[File:onboard.png]]
+
[[File:cm4-poeboard.jpg]]
  
[[File:onboard2.png]]<br />
 
 
==Special Pins Introduction==
 
==Special Pins Introduction==
 
[[File:pin.png]]<br />
 
[[File:pin.png]]<br />
Line 60: Line 61:
 
! !!Name!!Description
 
! !!Name!!Description
 
|-
 
|-
|1||EEPROM WP||Low level prevents EEPROM from being overwritten
+
|1||EEPROM WP||Low level prevents EEPROM from being modified
 
|-
 
|-
 
|2||VADC COMP||Composite video output
 
|2||VADC COMP||Composite video output
Line 70: Line 71:
 
|5||PI_RUN||CM4 status indication, high level means it is powered on, forcibly pull down to restart CM4
 
|5||PI_RUN||CM4 status indication, high level means it is powered on, forcibly pull down to restart CM4
 
|-
 
|-
|6||WIFI_EN||WIFI enable, disable at low level, open when pin is floating
+
|6||WIFI_EN||WIFI enable, disable at a low level, open when the pin is disconnected.
 
|-
 
|-
|7||BT_EN||Bluetooth enable, disable at low level, open when pin is floating
+
|7||BT_EN||Bluetooth enable, disable at a low level, open when the pin is disconnected.
 
|}
 
|}
 +
 
==Image Program==
 
==Image Program==
[https://www.waveshare.net/wiki/CM4_Burn_EMMC EMMC Version]<br />
+
*[https://www.waveshare.com/wiki/Write_Image_for_Compute_Module_Boards_eMMC_version EMMC Version]<br />
[https://www.waveshare.net/wiki/CM4_Burn_SD LITE Version]<br />
+
*[https://www.waveshare.net/wiki/CM4_Burn_SD LITE Version]<br />
 +
 
 
==RTC FAN==
 
==RTC FAN==
*Note: Please connect the fan before turning on the power of the expansion board and then complete the test. Please do not connect the fan after the expansion board has been powered on, that is, the fan control chip has been powered on, otherwise the chip will be burned!<br />
+
*<font color="#FF0000">Note: Please connect the fan before turning on the power of the expansion board and then complete the test. Please do not connect the fan after the expansion board has been powered on, that is, the fan control chip has been powered on, otherwise the chip will be burned!</font><br />
*Note: Before connecting, please confirm the fan voltage and the power supply of the actually connected fan<br />
+
*<font color="#FF0000">Note: Before connecting, please confirm the fan voltage and the power supply of the actually connected fan.</font><br />
Note DSI and CSI are prohibited using RTC<br />
+
<font color="#FF0000">Note DSI and CSI are prohibited using RTC.</font><br />
I2C-10 is used by default<br />
+
<font color="#FF0000">I2C-10 is used by default.</font><br />
  
 
RTC (PCF85063a) on i2c-10, address is 0x51 (7-bit address)<br />
 
RTC (PCF85063a) on i2c-10, address is 0x51 (7-bit address)<br />
Line 87: Line 90:
 
If you need to add to your program instead of the kernel, you can refer to the C and Python demo [https://www.waveshare.com/wiki/CM4_RTC_FAN Link]
 
If you need to add to your program instead of the kernel, you can refer to the C and Python demo [https://www.waveshare.com/wiki/CM4_RTC_FAN Link]
  
==RTC==
+
===RTC===
 
  sudo nano /boot/config.text
 
  sudo nano /boot/config.text
 
  #add it at the end
 
  #add it at the end
Line 109: Line 112:
 
  sudo hwclock -verbose
 
  sudo hwclock -verbose
  
==Fan==
+
===Fan===
 
When powered on, the fan will spin for 1 second, then stop for 2 seconds, and then spin again, this is a normal phenomenon
 
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 currently no official configuration method for fans, there is a third-party configuration method: https://github.com/neg2led/cm4io-fan
+
There is currently no official configuration method for fans, there is a third-party configuration method: https://github.com/neg2led/cm4io-fan<br>
 
This method is published by a third party, and we are not responsible for any problems!
 
This method is published by a third party, and we are not responsible for any problems!
[[File:fan1.png]]
+
<syntaxhighlight lang="python">
  #The following commands is the introduction for config.text
+
sudo apt-get install dkms
[[File:fan2.png]]
+
mkdir -p ~/src
 +
cd ~/src
 +
git clone https://github.com/neg2led/cm4io-fan.git
 +
cd cm4io-fan
 +
sudo chmod 777 install.sh
 +
sudo ./install.sh
 +
 
 +
#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)
 +
#############################
 +
</syntaxhighlight>
 
  or refer to:
 
  or refer to:
 
  dtoverlay=cm4io-fan,minrpm=500,maxrpm=5000,midtemp=45000,midtemp_hyst=2000,maxtemp=50000,maxtemp_hyst=2000
 
  dtoverlay=cm4io-fan,minrpm=500,maxrpm=5000,midtemp=45000,midtemp_hyst=2000,maxtemp=50000,maxtemp_hyst=2000
Line 121: Line 152:
  
 
==CSI DSI==
 
==CSI DSI==
===Configuration File===
+
{{CM4-CSI-DSI2}}
CSI and DSI are disabled by default. When using camera and DSI, three I2C devices, I2C-10, I2C-11, and I2C-0, will be occupied.
 
Start up as follows:
 
wget https:www.waveshare.net/w/upload/7/75/CM4_dt_blob_Source.zip
 
unzip -0 CM4_dt_blob_Source.zip -d ./CM4_dt_blob_Source
 
sudo chmod 777 -R CM4_dt_blob_Source
 
cd CM4_dt_blob_Source/
 
#If you exexute by using two cameras and SI0
 
sudo dtc -I dts -0 dtb -0 /boot/dt-blob.bin dt-blob-disp0-double_cam.dts
 
#If you exexute by using two cameras and SI0
 
sudo dtc -I dts -0 dtb -0 /boot/dt-blob.bin dt-blob-disp0-double_cam.dts
 
#When using DSI randomly, HDMI1 doesn't output the image even if just compiling the corresponding file without connecting the DSI screen
 
#if you want to restore, just delete corresponding dt-blob.bin. : sudo rm -rf /boot/dt-blob. bin
 
#Finished Power Off and reboot CM4
 
 
 
===Recording test===
 
Then connect the camera and DSI screen:<br />
 
1: Make sure the connection is power-off<br />
 
2: Connect Power<br />
 
3: Wait a few seconds for the screen to start up<br />
 
4: If it fails to start, check whether /boot/dt-blob.bin exists, and restart it if it exists.<br />
 
5: The camera needs to run raspi-config, select Interfacing Options->Camera->Yes->Finish-Yes, reboot the system, open the enable camera, and then restart to save the changes.<br />
 
 
 
;Old version (Buster)
 
Testing the Raspberry Pi Camera<br />
 
View the first connected camera screen:<br />
 
sudo raspivid -t 0 -cs 0
 
View the second connected camera screen:<br />
 
sudo raspivid -t 0 -cs 1
 
;New version (Bullseye)
 
Using the newest Raspberry Pi OS(Bullseye)
 
libcamera-hello -t 0
 
or
 
libcamera-hello
 
#Using two cameras in the new system
 
#Remove camera_auto_detect=1 in config.text
 
#camera_auto_detect=1
 
#Add
 
dtoverlay=omx219,cam1
 
dtoverlay=omx219,cam0
 
#imx219 is the  mode of camera sensor, and other sensors
 
dtoverlay=ov5647,cam0
 
dtoverlay=imx219,cam0
 
dtoverlay=ov9281,cam0
 
dtoverlay=imx477,cam0
 
#Then reboot
 
reboot
 
#other commands
 
#check the camera whether being detected
 
libcamera-hello -list-cameras
 
#Open corresponding camera
 
libcamera-hello -camera 1
 
libcamera-hello -camera 0
 
#Take Picture
 
libcamera-jpg -0 test.jpg
 
#Add -camera for the camera
 
More [https://www.raspberrypi.com/documentation/accessories/camera.html#libcamera-hello commands]
 
*Note: Using the DSI interface will make HDMI disabled, even if just compiling the corresponding file without connecting the DSI screen.
 
*Any connection of two HDMIs can output images, and it is not limited to that HDMI. If two HDMI screens are connected, only HDMI0 has image output.
 
*If you want to enable both HDMI, delete the dt-blob.bin file with the following command:
 
sudo rm -rf /boot/dt-blob.bin
 
*Then reboot
 
Refer to [https://www.raspberrypi.com/documentation/computers/compute-module.html Raspberry Pi Manual]
 
  
===INA219 Battery Level Detection===
+
==INA219 Battery Level Detection==
Enter the following command to run the program
+
Enter the following command to run the demo:
 
  sudo apt-get install p7zip
 
  sudo apt-get install p7zip
  wget https://www.waveshare.net/w/upload/5/59/CM4_UPS_Code.7z
+
  wget https://files.waveshare.com/upload/5/59/CM4_UPS_Code.7z
 
  7zr x CM4_UPS_Code.7z -r -o./
 
  7zr x CM4_UPS_Code.7z -r -o./
 
  cd CM4_UPS_Code
 
  cd CM4_UPS_Code
 
  python3 INA219.py
 
  python3 INA219.py
After the program runs, it will output the battery voltage, current, power and the percentage of remaining battery power.
+
After the program runs, it will output the battery voltage, current, power, and the percentage of remaining battery power.<br/>
 
[[File:battery.png]]
 
[[File:battery.png]]
;Note:if the current is positive, it means the output current of battery (which can be considered as the Raspberry Pi load current), and if the current is negative, it means the battery charging current.<br />
+
; Note: if the current is positive, it means the output current of the battery (which can be considered as the Raspberry Pi load current), and if the current is negative, it means the battery charging current.<br />
 
When the system load is heavy and the battery voltage is low, there may be a situation where the battery current is insufficient and the system restarts continuously. This is not expected to see. In practical applications, automatic shutdown can be avoided by judging that the battery voltage is too low.<br />
 
When the system load is heavy and the battery voltage is low, there may be a situation where the battery current is insufficient and the system restarts continuously. This is not expected to see. In practical applications, automatic shutdown can be avoided by judging that the battery voltage is too low.<br />
The battery voltage judgment has been added to the sample program. When the battery voltage is too low and there is no external power supply for charging, the program will shut down the system within 60s.<br />
+
The battery voltage judgment has been added to the sample demo. When the battery voltage is too low and there is no external power supply for charging, the program will shut down the system within the 60s.<br />
The program displays the following statement indicating that the battery voltage is too low and needs to be charged in time, otherwise the program will automatically shut down.<br />
+
The program displays the following statement indicating that the battery voltage is too low and needs to be charged in time, otherwise, the program will automatically shut down.<br />
  Voltage Low,please charge in time,otherwise it will shut down in 58 s
+
  Voltage Low, please charge in time, otherwise, it will shut down in 58 s
 +
If you need to use the camera or DSI screen, it is recommended to switch the I2C pin of the INA219 to GPIO2/3, and then modify it in the demo:
 +
<pre>
 +
#ina219 = INA219(i2c_bus=10,addr=0x43)
 +
ina219 = INA219(i2c_bus=1,addr=0x43)
 +
</pre>
  
 
=Resource=
 
=Resource=
===Manual===
+
==Manual==
 
*[https://datasheets.raspberrypi.com/cm4/cm4-datasheet.pdf CM4 Manual]
 
*[https://datasheets.raspberrypi.com/cm4/cm4-datasheet.pdf CM4 Manual]
*[https://www.waveshare.net/w/upload/3/39/CM4_POE_UPS_BASE_SchDoc.pdf schematic]
+
*[https://files.waveshare.com/upload/3/39/CM4_POE_UPS_BASE_SchDoc.pdf schematic]
===Program===
+
==Program==
*[https://www.waveshare.net/w/upload/3/31/CM4_Code.zip demo]<br>
+
*[https://files.waveshare.com/upload/3/31/CM4_Code.zip demo]<br>
*[https://www.waveshare.net/w/upload/5/59/CM4_UPS_Code.7z INA219 Battery detection]<br>
+
*[https://files.waveshare.com/upload/5/59/CM4_UPS_Code.7z INA219 Battery detection]<br>
===Software===
+
==Software==
*[https://{{SERVERNAME}}/w/upload/f/f3/Rpiboot_setup.zip RPiboot_Setup]<br>
+
*[https://files.waveshare.com/upload/d/d7/Panasonic_SDFormatter.zip Panasonic_SDFormatter-Formatting SD card]
*[https://{{SERVERNAME}}/w/upload/d/d7/Panasonic_SDFormatter.zip Panasonic_SDFormatter]
+
*[https://files.waveshare.com/upload/7/76/Win32DiskImager.zip Win32DiskImager]
*[https://{{SERVERNAME}}/w/upload/7/76/Win32DiskImager.zip Win32DiskImager]
+
*[https://files.waveshare.com/upload/5/56/Putty.zip Putty]
*[https://{{SERVERNAME}}/w/upload/5/56/Putty.zip putty]
+
*[https://files.waveshare.com/upload/f/f3/Rpiboot_setup.zip RPiboot_Setup]
  
 
=FAQ=
 
=FAQ=
{|style="margin-top: 10px; /*border-right: 20px solid transparent;*/ border-top: 20px solid {{{color|#EEE}}};"
+
{{FAQ|What should I do if the I2C address of the RTC/FAN controller cannot be found using i2cdetect -y 10?
 
|
 
|
{|class="roundy" style="margin-top: -30px; margin-left: -5px; margin-right: -5px; background: {{{color|#EEE}}};"
+
a) Check whether dtparam -audio -on is blocked in /boot/config.txt.<br/>
|'''Question:'''
+
b) Check whether the /boot/dt-blob.bin file exists, if it cannot be used, please delete it.
|-
+
}}
|What should I do if the I2C address of the RTC/FAN controller cannot be found using i2cdetect -y 10?
+
{{FAQ|Can I use the micro SD card interface to add more storage while I'm using my system on the emmc storage?
|}
 
|}
 
<br />
 
{|style="margin-top: 10px; /*border-left: 20px solid transparent;*/ border-top: 20px solid {{{color|#EEE}}};"
 
 
|
 
|
{|class="roundy mw-collapsible {{#if: {{{collapsed|}}}|mw-collapsed|}}" style="margin-top: -30px; margin-left: -5px; margin-right: -5px; background: {{{color|#EEE}}};"
+
I'm sorry to say that with the EMMC version of the CM4 Module, you won't be able to use an SD card.
|'''Answer:'''
+
||}}
|-
 
|a) Check whether dtparam -audio -on is blocked in /boot/config.txt
 
b) Check whether the /boot/dt-blob.bin file exists, if it cannot be used, please delete it;
 
 
 
|}
 
|}
 
  
 
=Support=
 
=Support=
{{Service02}}
+
{{Servicebox1}}

Latest revision as of 10:15, 25 March 2024

CM4-POE-UPS-BASE
CM4-POE-UPS-BASE
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

Introduction

This product is an IO board of the 4th generation of Raspberry Pi Compute Module. Compute Module 4 POE Board is a baseboard that can be used with Raspberry Pi Compute Module 4, supports POE power supply and 7~36V DC power supply with four onboard USB2 .0, which is for the user's convenience.

  • Before using the fan, the case needs to be assembled and the screws are fixed.

Users Guides

1: Confirm the fan voltage before connecting, it supports 5V and 12V. if you want to connect 12V by default, please modify the jumper cap of FAN_VCC.
2: The USB Type C interface is used as the USB SLAVE interface to burn the image, and it can also be used as the power supply interface, but cannot be used as the OTG interface.
3: The BOOT switch is for CM4 startup mode, the ON for CM4 to enter the programming mode, and the OFF for the system to start normally.
4: In normal use, it is necessary to provide at least a 5V/1.5A power supply for CM4. Otherwise, there may be problems such as automatic shutdown, frequency reduction, and so on.
5: USB2.0 is closed by default, if you want to open it, you need to add dtoverlay=dwc2,dr_mode=host in config.txt.
6: When using the POE function, pay attention to check whether the switch supports PoE of the 802.3af network standard.
7: When you need to use POE, connect the POE jumper cap to the EN position.
8: The Change LED light is the charging indicator, it is always on when charging, goes off when fully charged, and flashes when it fails.

Note

Note 1: When assembling, you need to turn the power switch to OFF first, disconnect the power supply and then assemble, otherwise the operation will easily cause a short circuit to burn the device.
Note 2: When connecting the battery for the first time, you need to pay attention to whether the WARNING LED is on. If the LED is on, it means that the corresponding battery is connected in reverse. Do not charge if the battery is reversed.
Note 3: When the battery is connected for the first time, there may be no power output. You need to press the BOOT activation button or charge the battery to activate the battery protection chip to have power output. The power switch needs to be turned to ON.
Note 4: It is forbidden to plug and unplug any device except USB and HDMI while the power is on.
Note 5: It is recommended not to exceed 4A when working with a high current for a long time. When working for a long time at 4A, it will heat up. Pay attention to heat dissipation.
Note 6: The external power supply must be greater than the power consumption of the entire system, otherwise there will not be enough current to charge the battery for a long time, and the battery power will become lower and lower until it is turned off.
Note 7: When the system load is heavy and the battery voltage is low, there may be a situation where the battery current is insufficient and the system keeps restarting.
Note 8: If the positive insulating pad of the battery is broken, it is recommended not to continue to use it, which may cause a short circuit and fire. When removing the battery, do not use a screwdriver to pry the positive electrode of the battery, which may cause a short circuit. It is recommended to pry the negative electrode of the battery.

Precautions for the use of lithium batteries

  • Li-polymer and Li-ion batteries are very unstable. Improper charging or use may result in fire, personal injury, and property damage.
  • Do not connect the wrong polarity when charging and discharging the battery pack. Do not use other inferior chargers or charging boards to charge the lithium battery.
  • Do not mix and use old and new batteries, and avoid using batteries of other brands.
  • If you need to purchase lithium battery products separately, you must ensure that the battery parameters are compatible with the lithium battery expansion board. It is recommended to choose a regular battery manufacturer, and you need to self-aging test to ensure that the lithium battery can work stably and safely.
  • Lithium batteries have a cycle life, please replace the old battery with a new one when it reaches its useful life or when it has been used for two years (whichever comes first).
  • Please place battery products properly, keep away from flammable and explosive items, keep away from children, and avoid safety accidents caused by careless storage.

Demension

Compute_Module 4 POE Board
De1.png
Compute_Module 4 core board
De2.png

Onboard Introduction

Cm4-poeboard.jpg

Special Pins Introduction

Pin.png

Name Description
1 EEPROM WP Low level prevents EEPROM from being modified
2 VADC COMP Composite video output
3 ETH IN ETH sync signal
4 PI_GLOBAL_EN CM4 onboard MXL7704 power pin, low level disable
5 PI_RUN CM4 status indication, high level means it is powered on, forcibly pull down to restart CM4
6 WIFI_EN WIFI enable, disable at a low level, open when the pin is disconnected.
7 BT_EN Bluetooth enable, disable at a low level, open when the pin is disconnected.

Image Program

RTC FAN

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

Note DSI and CSI are prohibited 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 to your program instead of the kernel, you can refer to the C and Python demo Link

RTC

sudo nano /boot/config.text
#add it at the end
dtparam=i2c_vc=on
dtoverlay=i2c-rtc, pcf85063a, i2c_csi_dsi
#add # before dtparam=audio=on
#dtparam=audio=on
#save and exit, reboot
sudo reboot
Hwclock Simple Use

Synchronize system clock -> hardware clock

sudo hwclock -w

Synchronize system clock -> system clock

sudo hwclock -s
#Require closing the network or invalid

Set up hardware clock time

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

Check the hardware clock

sudo hwclock -r

Display version information

sudo hwclock -verbose

Fan

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 currently no official configuration method for fans, there is a third-party configuration method: https://github.com/neg2led/cm4io-fan
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 https://github.com/neg2led/cm4io-fan.git
cd cm4io-fan
sudo chmod 777 install.sh
sudo  ./install.sh

#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 refer to:
dtoverlay=cm4io-fan,minrpm=500,maxrpm=5000,midtemp=45000,midtemp_hyst=2000,maxtemp=50000,maxtemp_hyst=2000
When the temperature is higher than 45 degrees Celsius and starts to accelerate, and the maximum speed is higher when it is more than 50 degrees Celsius

CSI DSI

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
wget https://files.waveshare.com/upload/7/75/CM4_dt_blob_Source.zip
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:
    CM4-NANO-B002.png
  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.
    CM4-NANO-B003.png
    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
    

    CM4-NANO-B005.png

  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.
    Interface.png
    3. Choose Camera:
    Camera.png
    4. Choose to enable the camera interface.
    Camera2.png
    5. The system prompts as follows:
    Prompt.png
    6. Back to the main interface, select Finish.
    Finish.png
    7. Reboot the system.
    Finish2.png


    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.

INA219 Battery Level Detection

Enter the following command to run the demo:

sudo apt-get install p7zip
wget https://files.waveshare.com/upload/5/59/CM4_UPS_Code.7z
7zr x CM4_UPS_Code.7z -r -o./
cd CM4_UPS_Code
python3 INA219.py

After the program runs, it will output the battery voltage, current, power, and the percentage of remaining battery power.
Battery.png

Note
if the current is positive, it means the output current of the battery (which can be considered as the Raspberry Pi load current), and if the current is negative, it means the battery charging current.

When the system load is heavy and the battery voltage is low, there may be a situation where the battery current is insufficient and the system restarts continuously. This is not expected to see. In practical applications, automatic shutdown can be avoided by judging that the battery voltage is too low.
The battery voltage judgment has been added to the sample demo. When the battery voltage is too low and there is no external power supply for charging, the program will shut down the system within the 60s.
The program displays the following statement indicating that the battery voltage is too low and needs to be charged in time, otherwise, the program will automatically shut down.

Voltage Low, please charge in time, otherwise, it will shut down in 58 s

If you need to use the camera or DSI screen, it is recommended to switch the I2C pin of the INA219 to GPIO2/3, and then modify it in the demo:

#ina219 = INA219(i2c_bus=10,addr=0x43)
ina219 = INA219(i2c_bus=1,addr=0x43)

Resource

Manual

Program

Software

FAQ

 Answer:

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

{{{3}}}
{{{4}}}

{{{5}}}


 Answer:

I'm sorry to say that with the EMMC version of the CM4 Module, you won't be able to use an SD card.

{{{5}}}


Support



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 PM GMT+8 (Monday to Friday)