CM4-POE-UPS-BASE
| ||
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
Compute_Module 4 core board
Onboard Introduction
Special Pins Introduction
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
1: Check whether the kernel version is higher or is 6.1.31.
uname --all
2:Add the following commands at config.txt:
dtoverlay=i2c-fan,emc2301,i2c_csi_dsi,midtemp=45000,maxtemp=65000
3:For more parameter configuration, please refer to this link.
Troubleshooting
1: After configuration, you can use the command "i2cdetect -y 10" to check whether the configuration is valid, and the valid I2C address should be UU without digits.
2: RTC value is not accurate, or an invalid prompt appears, check whether the RTC battery is connected and whether the voltage of the RTC battery is normal.
3: All configurations need to be rebooted after being added to take effect.
4: If the fan does not rotate after adding the fan driver, you can press "1" to troubleshoot and check whether the configuration is effective. If it is valid, then you can check whether the kernel version is higher or equal to 6.1.31 (uname --all). If the version is lower than 6.1.31, this kernel cannot work. For more details, you can refer to this link.
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.7z 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, please execute: sudo dtc -I dts -O dtb -o /boot/dt-blob.bin dt-blob-disp1-double_cam.dts # When using any DSI, there is no image output on HDMI1. Even if you do not connect a DSI screen, as long as the corresponding file is compiled, there will be no output on HDMI1. # To restore it, simply delete the corresponding dt-blob.bin file: sudo rm -rf /boot/dt-blob.bin #Execution is complete, power off and reboot CM4
New Version (Bullseye)
Camera Config
-
Execute the following commands to edit "/boot/config.txt" file.
sudo nano /boot/config.txt
- Block or remove the automatic camera detection statement:
-
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".
5. Ctrl+x to exit the editor.
6. Reboot the Raspberry Pi.
sudo reboot
Camera Test
- Enter the camera detection command, you can see that the camera is detected by now.
libcamera-hello --list-cameras
- Display the camera screen on the desktop.
- Taking photos.
libcamera-jpeg -o test.jpg
- Record a video of 10s.
libcamera-vid -t 10000 -o test.h264
Other Commands:
libcamera-hello -t
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.
- Test the recording function:
- Where -t 10000 means recording for 10 seconds, users can adjust according to their own needs.
- Please refer to CSI.
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
raspivid -o video.h264 -t 10000
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.
- 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
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.
{{{5}}}
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)