Google Chat: zj734465502@gmail.com
+86-0755-88291180
sales01@spotpear.com
dragon_manager@163.com
services01@spotpear.com
manager01@spotpear.com
WhatsApp:13246739196
Based on Raspberry Pi CM4, this is an industrial expansion module with a UPS module, which features common interfaces such as Gigabit Ethernet, HDMI, USB, and GPIO, allowing additional 4G / 5G wireless communication modules to be connected via the M.2 or Mini-PCIe socket. There are also industrial interfaces/resources including RS485, CAN, and RTC. Combined with the industrial rail-mount protection case, the module is an ideal choice for building IoT gateway, 4G/5G router, IoT data acquisition, or even the PLC device in the industrial automatic control system, and more.
1: Do not unplug devices other than USB and HDMI when powered on.
2: Confirm the fan voltage before connecting, support 5V and 12V by default connect 12V, switch please modify the FAN_VCC resistance. 3: In order to ensure the normal power supply of CM4, please do not connect other devices when using the Type C interface to program the image.
4: The module needs to be powered with 5V 2.5A /12V 1A or higher. Otherwise, there may be problems with automatic shutdown, degradation, etc. 5: The first time the battery is connected, there may be no power output, you need to press the BOOT activation button on the UPS module or charge the battery protection chip to activate the power output, the UPS module power switch needs to be set to the OFF position, the CM4 base plate switch is set to ON, ready to use. 6: The USB2.0 interface is disabled by default, you should add line dtoverlay=dwc2,dr_mode=host to the /boot/config.txt file to enable it.
7: When using UPS alone, the circuit should not exceed 2.5A, long working hours in the 2.5A state will heat up, pay attention to heat dissipation.
8. The external power supply must be greater than the overall system power, otherwise there is not enough current to charge the battery for a long time, and the battery power is getting low until shutdown.
9. When the system load is large and the battery voltage is low, there may be a lack of battery current and causing the system to constantly restart.
10: The battery is relatively strong, disassembly needs to be paired with tools (screwdriver), do not use a screwdriver to pry the battery positive pole easily leads to a short circuit, to pry the battery negative pole.
CM4-IO-WIRELESS-BASE-B
Compute_Module 4
NO. | Name | Description | |
1 | CM4 socket | suitable for all variants of Compute Module 4 | |
2 | HDMI connector | supports 4K 30fps output | |
3 | USB 2.0 ports | 3x USB 2.0, for connecting sorts of USB devices | |
4 | RJ45 Gigabit Ethernet | 10/100/1000M compatible | |
5 | DC power supply | 7 ~ 36V DC input | |
6 | CM4 status indicator | PWR (Red): Raspberry Pi power indicator ACT (Green): Raspberry Pi operating status indicator | |
7 | 4G/5G module status indicator | M.2 PWR (Red): module enable indicator M.2 NET (Green): module operating status indicator | |
8 | PWR & USB | 5V DC power supply or USB programming port | |
9 | M.2 B KEY | supports 4G/5G modules with M.2 B KEY connector, or other communication modules using USB channel | |
10 | Nano-SIM ard slot | supports standard Nano-SIM card for 5G/4G/3G/2G communication | |
11 | BOOT selection | ON: CM4 will be booted from USB-C interface OFF: CM4 will be booted from eMMC or TF card | |
12 | UPS module ON/OFF | ON: CM4 and the base board will be powered by UPS module OFF: Turn off the UPS power supply to CM4 and base board | |
13 | DC power supply | 7 ~ 36V DC input | |
14 | Dual non-isolated RS485 | 2x RS485, with 600W lightningproof, anti-surge, and 15KV ESD protection (reserved 120R optional balancing resistor jumper) | |
15 | Non-isolated CAN | ESD protection and transient spike voltage protection (reserved 120R optional balancing resistor jumper) | |
16 | Micro SD card slot | for connecting a TF card with pre-burnt image (Lite variant ONLY) | |
17 | FAN header | for connecting cooling fan, allows speed adjustment and measurement | |
18 | CAM | MIPI CSI camera port, 15Pin 1mm pitch | |
19 | RTC battery holder | supports CR1220 button cell | |
20 | M.2 VCC selection | select 3.3V or 4.2V power supply | |
21 | RTC interruption configuration | PI-RUN: CM4 will reboot on RTC interruption GL-EN: CM4 power down on RTC interruption D17: D17 pin is triggered on RTC interruption (default) | |
22 | IO-VREF selection | set the CM4 IO logic level as 3.3V (default) or 1.8V | |
23 | FAN power supply selection | select 12V (default) or 5V power to drive the fan | |
24 | System function configuration | BT_DIS: Bluetooth disabled, for CM4 with antenna variant ONLY WiFi_DIS: WiFi disabled, for CM4 with antenna variant ONLY WP_DIS: boot mode switch, ONLY be used when NOT booted from eMMC or SD card | |
25 | RTC/FAN I2C bus selection | SDA0/SCL0: I2C-10 is shared with CSI/DSI (default) GPIO3/2: I2C-1 is shared with GPIO header | |
26 | Partial GPIO header | including 1x I2C, 2x GPIO pins, and power supply | |
27 | UPS Module Mini header | Adopts 10440 3.7V Lithium battery |
Prohibit unplugging any equipment while powered.
The default is off, if you want to turn it on, you need to add the following to config.txt:
sudo nano /boot/config.txt dtoverlay=uart3 dtoverlay=uart5
The device numbers are:
/dev/ttyAMA1 /dev/ttyAMA2
Close by default, if you want to open it, you need to add the following content in config.txt:
# Open and edit config.txt sudo nano /boot/config.txt #Add the following dtparam=spi=on dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25 #reboot reboot
Execute after rebooting:
dmesg | grep spi0
sudo ip link set can0 up type can bitrate 1000000 sudo ifconfig can0 txqueuelen 65536 ifconfig
The can0 device number appears meaning drive successfully.
Install can-utils:
sudo apt-get install can-utils
Receive data:
candump can0
Send data:
cansend can0 000#11.22.33.44 #Where 11.22.33.44 is the data #If you need to send additional data you can use the Continue to add for example # cansend can0 000#11.22.33.04.70 #English and Chinese are not allowed, and two codes are added in one format.
On-board M.2 B KEY with internal PCIE, USB2.0, GPIO, I2C, SPI interfaces.
The default can only be connected to
SIM7600G-H-M.2
SIM8202G-M2
SIM8200EA-M2
M.2 B KEY interface modules, etc.
SSD supporting NVME 2242 with M.2 B KEY interface.
The board itself does not support 4G/5G, you need to access the module through the M.2 B KEY interface, M.2 B KEY only USB2.0 channel.
Connect the 4G/5G module and insert the SIM card afterward.
If you need to turn off the 4G/5G module, you can use GPIO6 (BCM code 6) control, GPIO6 output a high level to turn off the module, and GPIO6 output a low level to turn on the module.
It takes some time (about 30 seconds) to turn off or turn on the module if the antenna is not connected or the SIM card is not connected before turning on the module.
If the module can not be turned on, it may be GPIO6 pin is pulled high, please use the following command to pull the GPIO6 pin low to turn it on:
echo Exporting pin 6 echo 6 > /sys/class/gpio/export echo Setting direction to out. echo out > /sys/class/gpio/gpio6/direction echo Setting pin 0
M.2 status indicator:
STA | NET | Status |
---|---|---|
Always on | Off | Shutting down or turning on |
Always on | Always on | Searching the web |
Always on | Flash | Networked and working normally |
Off | Flash/Always on | Shutting down |
Make sure the module is powered on before configuration.
For 5G, you can refer to [5G Configuration]
sudo apt-get install minicom sudo minicom -D /dev/ttyUSB2 # Enter the following command: AT+CUSBPIDSWITCH=9011,1,1 #return OK and you're done #Then wait for the card to reboot #This command only needs to be set once, the next power-up will default in this mode #If you can't get the USB0 NIC to execute. sudo dhclient -v usb0
AT+CNBP=0x0002000000400183,0x000001E000000000,0x0000000000000021 AT+CNBP=0x0002000000400180,0x480000000000000000000000000000000000000000000042000001E200000095,0x0000000000000021
If you cannot connect to the network, you can check the status by AT commands:
sudo apt-get install minicom sudo minicom -D /dev/ttyUSB2
The following AT commands are for 4G/5G modules:
Command | Description | Return Value |
---|---|---|
AT | AT Test Commads | OK |
ATE | ATE1 sets echo ATE0 turns off echo|| OK | |
AT+CGMI | Inquire about module manufacturers | OK |
AT+CGMM | Inquire about module model | OK |
AT+CGSN | Inquire about product serial number | OK |
AT+CSUB | Check module version and chip | OK |
AT+CGMR | Check the firmware version serial number | OK |
AT+IPREX | Set the module hardware serial port baud rate | +IPREX: OK |
AT+CRESET | Retset module | OK |
AT+CSQ | Network signal quality query, return signal value | +CSQ: 17,99 OK |
AT+CPIN? | Query SIM card status, return READY, means SIM card can be recognized normally | +CPIN: READY |
AT+COPS? | Query the current operator, the operator information will be returned after normal networking | +COPS: OK |
AT+CREG? | Check network registration status | +CREG: OK |
AT+CPSI? | Query UE system information | |
AT+CNMP | Network mode selection command: 2: Automatic 13:GSM only 38: LTE only 48: Any modes but LTE ... .... | OK |
For more AT commands, you can refer to SIM7500 SIM7600 Series AT Command Manual V2.00.pdf.
For more documents, you can refer to SIMCom.
Use the Raspberry Pi system(2021-05-07-raspios-buster-armhf-full )
Note: Do not use DSI and CSI when using RTC.
If simultaneous use is required, switch I2C to the I2C1 device (right).
All demos or drivers need to be modified after switching.
Demos adopt I2C10 (left) by default.
For simple use, or to add to your program, refer to the C and Python references. Click here to see.
Here's how to add the driver to the kernel:
sudo nano /boot/config.txt # Add at the end dtparam=i2c_vc=on dtoverlay=i2c-rtc,pcf85063a,i2c_csi_dsi # add # sign in front of dtparam=audio=on #dtparam=audio=on #Save to exit and reboot sudo reboot
Synchronize system clock -> Hardware clock.
sudo hwclock -w
Synchronize the hardware clock -> system clock.
sudo hwclock -s # Need to turn off the network, or turn off the network pair time, the responsible will be changed back
To set the hardware clock time:
sudo hwclock --set --date="9/8/2021 16:45:05"
To view the hardware clock:
sudo hwclock -r
Show version information:
sudo hwclock --verbose
When the power is on, the fan will turn for 1 second, then stop for 2 seconds, then turn again, this is a normal phenomenon.
Fan currently has no official configuration method, there is a third-party configuration method: https://github.com/neg2led/cm4io-fan
This method is a third-party release, not the official release, any problems, not responsible!
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 #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 directly to the following: dtoverlay=cm4io-fan,minrpm=500,maxrpm=5000,midtemp=45000,midtemp_hyst=2000,maxtemp=50000,maxtemp_hyst=2000 Temperature above 45 degrees Celsius starts to accelerate, above 50 degrees Celsius maximum speed.
If there is a failure to compile properly, you can click here.
CSI and DSI are off by default when using the camera and DSI will occupy I2C-10, I2C-11, and I2C-0.
The DSI interface of CM4-DUAL-ETH-4G/5G-BASE is the DSI1 interface.
The power-on execution is as follows:
sudo apt-get install p7zip-full wget https://www.waveshare.com/w/upload/4/41/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 you use two cameras and DSI0 to execute sudo dtc -I dts -O dtb -o /boot/dt-blob.bin dt-blob-disp0-double_cam.dts #If two cameras and DSI1 are used to perform 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, just delete the corresponding dt-blob.bin, e.g. sudo rm -rf /boot/dt-blob.bin #Execution complete, Power off, Restart CM4
Then connect the camera and DSI screen to:
Reference:
Testing the Raspberry Pi camera To view the first camera screen accessed:
sudo raspivid -t 0 -cs 0
To view the second camera screen:
sudo raspivid -t 0 -cs 1
You can refer to CSI camera and DSI display.
sudo apt-get install p7zip wget https://www.waveshare.com/w/upload/5/59/CM4_UPS_Code.7z 7zr x CM4_UPS_Code.7z -r -o./ cd CM4_UPS_Code python3 INA219.py
Note: A positive current indicates the battery output current (which can be considered as Raspberry Pi load current), and if the current is negative, it indicates the battery charging current.
When the system load is high and the battery voltage is low, there is a possibility that the battery current will be insufficient and the system will keep rebooting. This is not desired. The actual application can be avoided by judging that the battery voltage is too low to shut down automatically.
The sample demo has added the battery voltage judgment, the demo will shut down the system within the 60s when the battery voltage is too low and there is no external power supply for charging.
The demo shows the following statement that the battery voltage is too low and needs to be charged in time, otherwise, the demo will shut down automatically.
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 After the switch the program is modified to:
#ina219 = INA219(i2c_bus=10,addr=0x43) ina219 = INA219(i2c_bus=1,addr=0x43)
a) Check if dtparam -audio -on is blocked in /boot/config.txt.
b) Check if the /boot/dt-blob.bin file exists, if it does, please delete it.