Google Chat: zj734465502@gmail.com
+86-0755-88291180
sales01@spotpear.com
dragon_manager@163.com
services01@spotpear.com
manager01@spotpear.com
WhatsApp:13246739196
The CM4-NAS-Double-Deck is an all-in-one mini computer designed primarily for home environments or small home offices, but not limited to these scenarios. Out of the box, no expert knowledge of networking and storage systems is required.
sudo apt-get install unzip -y wget https://www.waveshare.com/w/upload/7/73/CM4-NAS-Double-Deck_Demo.zip unzip CM4-NAS-Double-Deck_Demo.zip sudo chmod 777 -R CM4-NAS-Double-Deck_Demo cd CM4-NAS-Double-Deck_Demo/RaspberryPi/example/ python main.py
sudo nano /etc/rc.local #Add the following statement directly in fi and exit0, be sure to add &, if you don't add it, it won't start automatically cd /home/pi/RaspberryPi/example sudo python main.py &
PWR: *Short press in shutdown state: power on *Short press in the power-on state: turn on/off the 2-inch screen display *Long press in the power-on state: Forced shutdown USER: *Short press in the power-on state: switch to another interface (in the case of running the example, otherwise invalid) *Long/short press in shutdown state: invalid
The USB port is disabled by default on the CM4 to save power. If it needs to be enabled, you need to add the following to the config.txt file:
dtoverlay=dwc2,dr_mode=host
Then reboot it.
If you use the latest Raspberry Pi OS (image after October 30, 2021), USB2.0 is the default OTG mode, and CM4 will report an error:
config failed, hub doesn't have any ports! (err -19)
However, USB can still be used. If you want to remove this error, remove otg_mode=1 in [cm4] of config.txt, and add dtoverlay=dwc2, dr_mode=host (if you don't add it, USB can not be recognized).
RTC (PCF85063a) on i2c-1, the address is 0 x 51 (7-bit address).
sudo nano /boot/config.txt
#add in the end
dtparam=i2c_vc=on
dtoverlay=i2c-rtc,pcf85063a,i2c_csi_dsi
#Add # before dtparam=audio=on
#dtparam=audio=on
#Save, exit, and reboot
sudo reboot
Synchronize system clock -> hardware clock.
sudo hwclock -w
Synchronize hardware clock -> system clock.
sudo hwclock -s
#Need to close the network or close the network time, otherwise, it will be changed back.
Set the hardware clock time:
sudo hwclock --set --date="9/8/2021 16:45:05"
View the hardware clock.
sudo hwclock -r
Show version information.
sudo hwclock --verbose
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://www.waveshare.com/w/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/
#If you want to use two cameras and DSI0, you can execute:
sudo dtc -I dts -O dtb -o /boot/dt-blob.bin dt-blob-disp0-double_cam.dts
#If you want to use two cameras and DSI1, you can execute:
sudo dtc -I dts -O dtb -o /boot/dt-blob.bin dt-blob-disp1-double_cam.dts
#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
#Execution is complete, turn off the power and restart CM4
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.
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
If you use the latest Raspberry Pi OS (Bullseye):
#The new system uses dual cameras
#Remove camera_auto_detect=1 in config.txt
#camera_auto_detect=1
#Add to
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
#Taking 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.
sudo rm -rf /boot/dt-blob.bin
Please refer to Raspberry Pi manual.
Connect to the camera again:
1: Make sure to connect in the power off state.
2: Connect the power supply.
3: Wait a few seconds for the screen to boot.
4: If it cannot be started, check whether /boot/dt-blob.bin exists and if it exists, restart it again.
5: 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 photo:
raspistill -o image.jpg
Test video:
raspivid -o video.h264 -t 10000
Among them, -t 10000 means recording for 10 seconds, and users can adjust it according to their own needs.
Please refer to CSI camera.