CM4-POE-UPS-BASE

From Waveshare Wiki
Jump to: navigation, search
CM4-POE-UPS-BASE
CM4-POE-UPS-BASE
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

{{{name6}}}

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 flash 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

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

CSI DSI

New Version (Bookworm)

The DSI screen is 800x480 resolution screen by default, please refer to the corresponding WIKI for other resolution screens

When using the official base board Compute Module 4 IO Board, note that the J6 jumper cap needs to be connected


DSI

#Add the following to the config.txt file:
sudo nano /boot/firmware/config.txt
#DSI0 (V1~V3)
dtoverlay=vc4-kms-dsi-7inch,dsi0
#DSI1 (V4)
dtoverlay=vc4-kms-dsi-7inch,dsi1

CSI

  • Add the following to the config.txt file:
  • sudo nano /boot/firmware/config.txt
    Mode CAM0 setup statement CAM1 setup statement
    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
    IMX296 dtoverlay=imx296,cam0 dtoverlay=imx296,cam1
    IMX708 dtoverlay=imx708,cam0 dtoverlay=imx708,cam1
  • Use the shortcut Ctrl+o to save the file, then press Enter
    CM4-NANO-B-CSI-03.png
  • Use the shortcut Ctrl+x to exit the editor
  • Reboot the device
    sudo reboot
  • Note:

    1. The single-port camera can only work on CAM0, that is, it is not possible to use CAM1 port alone. But you can use the CAM0 port alone, or connect the dual cameras
    2. If the device is recognized, and the startup prompt "Camera frontend has timed out!" appears, please update "sudo rpi-update"
    
    Test Camera
    1. Enter the camera detection command, and you can see that the camera has been detected
      libcamera-hello --list-cameras

      CM4-NANO-B-CSI-01.png
    2. Display the camera screen to the desktop
      libcamera-hello -t 0
    3. Take a photo
      libcamera-jpeg -o test.jpg
    4. Record a 10s video
      libcamera-vid -t 10000 -o test.h264

    Other commands
    Check if the camera is detected

    libcamera-hello --list-cameras
    

    Open the corresponding camera

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

    Take a photo

    libcamera-jpeg -o test.jpg
    #You can add --camera to specify the camera
    


    #The new system uses dual cameras
    #Remove camera_auto_detect=1 in config.txt
    #camera_auto_detect=1
    
    #Add
    dtoverlay=imx219,cam1
    dtoverlay=imx219,cam0
    
    #Where imx219 is the camera sensor model and other sensors are supported
    dtoverlay=ov5647,cam0
    dtoverlay=imx219,cam0
    dtoverlay=ov9281,cam0
    dtoverlay=imx477,cam0
    dtoverlay=imx519,cam0
    
    #Then reboot
    reboot
    
    #Open camera
    libcamera-hello -t 0
    or
    libcamera-hello
    
    
    #Other instructions:
    #Check if the camera is detected
    libcamera-hello --list-cameras
    
    #Open the corresponding camera, preview for 5 seconds
    libcamera-hello  --camera 1
    libcamera-hello  --camera 0
    
    #Take photos
    libcamera-jpeg -o test.jpg
    
    #Shoot video
    libcamera-vid -t 10000 -o test.h264
    
    #You can add --camera to specify the camera
    #-t <duration> option allows the user to choose how long the window is displayed in milliseconds

    For more commands, you can click here.

    • Note: If using a DSI interface display there will be an HDMI disabled, even if just compiling the corresponding file without connecting a DSI screen.
    • Connecting either HDMI port will allow output of an image, regardless of which HDMI port is used. If two HDMI screens are connected, only HDMI0 has an image output.
    • To enable two HDMI ports, remove the configuration from config.txt:
    • And then reboot it.

    Please refer to Raspberry Pi manual.

    Old System Version (Buster and Bullseye)

    Configure Files

    CSI and DSI are disabled by default. When using the camera and DSI, three I2C devices, I2C-10, I2C-11, and I2C-0 will be occupied.
    Booting is performed as follows:

    wget https://files.waveshare.com/upload/7/75/CM4_dt_blob_Source.zip
     unzip -o CM4_dt_blob_Source.zip -d ./CM4_dt_blob_Source
     sudo chmod 777 -R CM4_dt_blob_Source
     cd CM4_dt_blob_Source/
     #Execute (for version V1~V3)
     sudo  dtc -I dts -O dtb -o /boot/dt-blob.bin dt-blob-disp0-double_cam.dts
     #Execute (for version V4)
     sudo  dtc -I dts -O dtb -o /boot/dt-blob.bin dt-blob-disp1-double_cam.dts
    
     Add the following to the config.txt file:
     sudo nano /boot/config.txt
     Change dtoverlay=vc4-kms-v3d to
     dtoverlay=vc4-fkms-v3d
    
     #When using any DSI, HDMI1 has no image output, even if you are not connected to the DSI screen, as long as you compile the corresponding file, then HDMI1 will have no output
     #If you need to restore, delete the corresponding dt-blob.bin: sudo rm -rf /boot/dt-blob.bin 
     #After execution, turn off the power and restart

    Record Test

    Connect to the camera and the DSI display:
    1. Please make sure it is connected under powering off.
    2. Connect to the power.
    3. The display will be booted after waiting for a few seconds.
    4. If it fails to boot, check whether /boot/dt-blob.bin exists, and reboot it if it exists.

    Old Version (Buster)

    The camera needs to run raspi-config, select Interfacing Options -> Camera -> Yes -> Finish -> Yes, reboot the system, open enable camera, and then restart to save the changes.

    Test the Raspberry Pi camera.
    Check the screen of the first connected camera:

    sudo raspivid -t 0 -cs 0
    

    Check the screen of the second connected camera:

    sudo raspivid -t 0 -cs 1
    


    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)