CM4-POE-UPS-BASE

From Waveshare Wiki
Jump to: navigation, search
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 AM GMT+8 (Monday to Friday)