跳转到内容
主菜单
主菜单
移至侧栏
隐藏
导航
首页
最近更改
随机页面
MediaWiki帮助
Mcuzone Wiki
搜索
搜索
登录
个人工具
登录
查看“0012 MPUUART/MP4232 EN”的源代码
页面
讨论
大陆简体
阅读
查看源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
查看源代码
查看历史
常规
链入页面
相关更改
特殊页面
页面信息
←
0012 MPUUART/MP4232 EN
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
[[0012 MPUUART/MP4232|切换语言为中文]] == '''Keywords''' == Raspberry Pi 5, PCIe, Switch, VL805, TTL, RS232, RS485, Serial == '''I. Introduction''' == The Raspberry Pi 5 features a 16-pin PCIe interface, which can be utilized for the expansion of various peripherals. We can expand into four USB interfaces through the PCIe interface paired with a PCIe to USB chip, and then achieve four serial ports using the CH344Q chip. This expansion board comes in two versions: one is the MP4232 expansion board, which provides an expansion of 4 RS232 ports. This expansion board does not require any drivers under Raspberry Pi or Ubuntu and will be automatically recognized as four RS232 serial ports (ttyACM0, ttyACM1, ttyACM2, ttyACM3) once powered on. The other version is the MPUUART expansion board, which provides an expansion for dual RS232 and dual RS485 ports. This expansion board does not require any drivers under Raspberry Pi or Ubuntu and will be automatically recognized as ttyACM0, ttyACM1, ttyACM2, and ttyACM3 once powered on. Among these, ttyACM0 and ttyACM3 are RS232 serial ports, while ttyACM1 and ttyACM2 are RS485 serial ports. The baud rate for RS232 can reach over 230 Kbps (with a tested speed of up to 1.2 Mbps when two adjacent RS232 ports are connected), while the baud rate for TTL/CMOS UART can reach up to 6 Mbps. The expansion board also has three USB 2.0 ports reserved, which can be used to extend a 4G LTE module. The 4G module provided by our company is driver-free and dial-up-free on both the Raspberry Pi and Ubuntu. The system automatically recognizes it, allowing for plug-and-play functionality without the need to install additional drivers. == '''II. Hardware Spec''' == 1. One PCIe interface, 0.5mm 16P FPC for communication with Raspberry Pi 5, adopting a design of PCIe to four high-speed USB2.0. 2. Three-way HS USB2.0, 1.25mm-4P interface, expandable CM4 4G Mini module. 3. The MPUUART expansion board converts four serial ports via a USB 2.0 high-speed interface, featuring two RS232 ports and two RS485 ports with power isolation design. The RS232 ports can be modified to a TTL/CMOS level UART and is led out through a 3.81-3Pin connector. 4. The MP4232 expansion board converts four serial ports via a USB 2.0 high-speed interface, implementing a four-channel RS232 design with 3.81-3p terminals. 5. Four LEDs are included: a PWR LED that is powered via the Raspberry Pi 5's PCIe interface, an ACT LED for the USB-to-serial chip, and two transmit/receive LEDs. 6. Size: 56x85mm, four M2.5 mounting holes, consistent with those on the Raspberry Pi 5; 7. The expansion board provides mounting holes for a 4G module and supports stacking of 1-3 4G modules. 8. Aluminum alloy enclosure(OPT). 9. Customizable interface levels are available, such as configuring four TTL/CMOS serial ports, or four RS485 serial ports. 10. The MPUUART uses gold immersion process, lead-free production, and the material has passed UL and ROHS certifications with a flame retardant rating of 94V-0. http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_71.jpg http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_72.jpg http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_73.jpg http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_74.jpg http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_75.jpg == '''III. Work with Raspberry Pi OS''' == Since the expansion board utilizes the PCIe interface of the Raspberry Pi 5, the system can only be booted from an SD card (TF card). Please refer to the following link for instructions on how to burn the system image to a TF card: [[0005 MPS2242 2280 2280P EN#3.2 Boot from TF card|Flash the OS using a TF card]] The version of the Raspberry Pi OS is: 2024-07-04-raspios-bookworm-arm64.img.xz You can download the Raspberry Pi OS in: https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-64-bit === 3.1 Install CuteCom === The installation command for CuteCom is: <code>sudo apt install cutecom</code> After installation, click on the Raspberry Pi icon in the top left corner of the desktop, and you will find a shortcut for CuteCom under "System Tools". http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_01.jpg === 3.2 Test MP4232 === The names of the four serial ports on the MP4232, from top to bottom, are as follows: ttyACM3、ttyACM0、ttyACM1、ttyACM2 http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_55.jpg The connection correspondence between the two RS232 serial ports is: R - T G - G T - R Execute <code>lsusb</code>, and we can see VL805 and CH344Q: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_03.jpg Execute <code>ls /dev</code>, and we can see four serial ports: ttyACM0、ttyACM1、ttyACM2、ttyACM3: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_31.jpg We use a serial cable to connect any two of the serial ports and perform data transmission tests using CuteCom. According to the tests, under the Raspberry Pi OS, the baud rate can reach up to 1.21 Mbps (based on data transmission without garbling). http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_02.jpg === 3.3 Test MPUUART === The MPUUART has four serial ports; the two on top are RS232 ports (ttyACM0, ttyACM3), and the two at the bottom are RS485 ports (ttyACM1, ttyACM2). http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_56.jpg The connection correspondence between the two RS485 serial ports is: G - G A - A B - B Execute <code>lsusb</code>, and we can see VL805 and CH344Q: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_10.jpg Execute <code>ls /dev</code>, and we can see four serial ports: ttyACM0、ttyACM1、ttyACM2、ttyACM3: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_32.jpg We use a serial cable to connect two of the RS232 serial ports and perform data transmission tests using CuteCom. According to the tests, under the Raspberry Pi OS, the baud rate can reach up to 1.22 Mbps (based on data transmission without garbling). http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_12.jpg We use a serial cable to connect two of the RS485 serial ports and perform data transmission tests using CuteCom. According to the tests, under the Raspberry Pi OS, the baud rate can reach up to 2.02 Mbps (based on data transmission without garbling). http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_13.jpg === 3.4 Test 4G module === The CM4 4G mini module provided by our company is driver-free, does not require dialing, and is automatically recognized with plug-and-play functionality under the Raspberry Pi system. The 4G models include CM4 4G mini (CAT4 4G), Qualcomm 4G, and Qualcomm 4G-GPS. http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_64.jpg The CAT4 4G is recognized as an eth device in the system, while the Qualcomm 4G is recognized as a usb0 device in the system.http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_39.jpg http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_77.jpg ==== 3.4.1 Module connection ==== After starting Raspberry Pi OS, execute <code>lsusb</code>, as shown in the following image: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_41.jpg http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_78.jpg Execute <code>ifconfig -a</code>, and we can see that the 4G module (eth1 or usb0) has correctly obtained an IP address. http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_39.jpg http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_77.jpg If you cannot see the 4G module (eth1), please check if the connections are correct and use the <code>lsusb</code> command to verify if the module is recognized by the OS. The status of Status LED: '''CAT4 4G:''' The blinking pattern, where the light is on for 1.8 seconds and off for 0.2 seconds (alternatively, you can judge by the light being on longer than it is off), indicates that the 4G module has connected to the network. The blinking pattern, where the light is off for 1.8 seconds and on for 0.2 seconds, indicates that there is an issue with the SIM card or the network. Please check the SIM card and the antenna. '''Qualcomm 4G:''' If the LED is blinking slowly with occasional rapid flashes in between, it indicates that the 4G module has connected to the network. Otherwise, it suggests there might be an issue with the SIM card or the network; please check the SIM card and the antenna. After the 4G module correctly obtains an IP address, we can ping an external web address, such as: <code>ping www.mcuzone.com</code> http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_43.jpg You can also connect to the external network through the 4G module and visit a [https://www.speedtest.cn/ speed test website] to measure the speed: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_44.jpg '''''Note: Network speed tests are affected by the network environment and testing methods. Please refer to the actual speed, as this test is for reference only.''''' ==== 3.4.2 AT command operation ==== Taking CAT4 4G as an example, execute <code>lsusb</code> in terminal: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_04.jpg Record the ID value of the 4G module: 05c6 90b6 Use the following command to open the ttyUSB serial port, where the value after echo is the ID recorded above: <code>sudo modprobe option</code> <code>sudo sh -c 'echo 05c6 90b6 > /sys/bus/usb-serial/drivers/option1/new_id'</code> After execution is complete, the system should have four additional devices: ttyUSB0 - ttyUSB3, execute <code>ls /dev/ttyUSB*</code> to view: http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_60.jpg Install minicom: <code>sudo apt-get install minicom</code> Open AT Command serial port by minicom: <code>sudo minicom -D /dev/ttyUSB1</code> (Note: Which serial port to use should be determined by the ability to enter and execute AT commands without garbled or erratic output after accessing that serial port.) If you need to view the echo, please type the command <code>ate1</code>, then execute other commands. http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_45.jpg Common AT command: 1) Check if the SIM card is detected: <code>at+cpin?</code> Return ready to indicate the card has been recognized, if return error, you need to check the hardware. 2) Check antenna signal quality: <code>at+csq</code> eturn values between 26 and 31 indicate a good signal, with 31 representing a full signal strength; return values between 20 and 25 indicate a barely acceptable signal; return values below 20 indicate a poor signal or that the antenna might not be connected. 3) Check network registration status: <code>at+cops?</code> Normally, it should return the network supporter's code: 7, where 7 represents 4G. Note: The above command <code>at+csq</code> should not include a question mark, while the other two commands require a question mark. 4) View the SIM card's IMEI code: <code>at+cgsn</code> 5) Reset 4G module (Sometimes, if you reinsert the SIM card, hot swapping may not work; in such cases, you can use this reset command to reset the module.): <code>at+reset</code> 6) Disable radio frequency: <code>at+cfun=0</code> Enable radio frequency: <code>at+cfun=1</code> The two commands mentioned above can be used in pairs to allow the module to re-register with the network without restarting the 4G module. ==== 3.4.3 Modify the IP address of the 4G module ==== If the default 4G IP address assigned at the factory conflicts with the IP address being used by the user, or if there is a need to modify the IP address, you can change the 4G module's IP to directly obtain a public IP. '''CAT4 4G:''' Execute the AT command: <code>AT+ROUTEIP=<newip></code> Note: only addresses in the format of 192.168.x.1 are supported. If you set <code>AT+ROUTEIP=192.168.3.1</code>, the final IP address obtained will be 192.168.3.100. After making the changes, you need to power off and restart the OS. Query current IP: <code>AT+ROUTEIP?</code>, it returns two values, the first one is the old IP, and the second one is the new IP. Test command: <code>AT+ROUTEIP=?</code> '''Qualcomm 4G:''' Set the 4G module's IP to directly obtain a public IP. Please execute the AT command: Set the IP to public: <code>AT+GTIPPASS=1</code> Set the IP to private: <code>AT+GTIPPASS=0</code> Check whether the current IP is a public or private IP: <code>AT+GTIPPASS?</code> After modifying the IP, a power cycle reboot is required for the changes to take effect. ==== 3.4.4 GPS test (Applicable to the Qualcomm 4G-GPS) ==== If you have chosen the Qualcomm 4G-GPS, this 4G module comes with GPS functionality. You need to connect a passive GPS antenna and ensure that the GPS antenna is placed outdoors. Execute the command <code>lsusb</code>, as shown in the figure below: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_04.jpg Note down the ID of the 4G module: 05c6 90b6. Use the following command to open the ttyUSB serial port, where the value following echo is the ID value recorded above: <code>sudo modprobe option</code> <code>sudo sh -c 'echo 05c6 90b6 > /sys/bus/usb-serial/drivers/option1/new_id'</code> After executing the two commands above, the system should have three additional devices: ttyUSB0/1/2. You can check them by executing <code>ls /dev</code>: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_06.jpg Execute minicom and open the ttyUSB0 serial port: <code>sudo minicom -D /dev/ttyUSB0</code> Then execute: <code>at+gtgpsepo=1</code> //Enable AGPS <code>at+gtgpspower=1</code> //Enable GPS Wait a moment for the positioning to succeed, then execute: <code>at+gtgps?</code> //View NMEA information You can then see that the serial port outputs GPS information: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_70.jpg == '''IV. Work with Ubuntu OS''' == The version of the Ubuntu OS is: ubuntu-24.04-preinstalled-desktop-arm64+raspi.img.xz, You can download the Ubuntu OS in: https://ubuntu.com/download/raspberry-pi === 4.1 Install CuteCom === The installation command for CuteCom is: <code>sudo apt install cutecom</code> After installation, click on the "Show Apps" icon in the lower left corner of the desktop. There will be a shortcut for CuteCom. http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_05.jpg But if you directly open CuteCom, there might be an issue where the input box does not accept characters. This is caused by insufficient permissions. So you need to open the terminal and execute: <code>sudo cutecom</code> http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_06.jpg to open CuteCom. If you need to open a second instance of CuteCom, you will have to open another terminal and execute the command to launch CuteCom. === 4.2 Test MP4232 === The names of the four serial ports on the MP4232, from top to bottom, are as follows: ttyACM3、ttyACM0、ttyACM1、ttyACM2 http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_55.jpg The connection correspondence between the two RS232 serial ports is: R - T G - G T - R Execute <code>lsusb</code>, and we can see VL805 and CH344Q: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_07.jpg Execute <code>ls /dev</code>, and we can see four serial ports: ttyACM0、ttyACM1、ttyACM2、ttyACM3: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_33.jpg We use a serial cable to connect any two of the serial ports and perform data transmission tests using CuteCom. According to the tests, under the Ubuntu OS, the baud rate can reach up to 1.15 Mbps (based on data transmission without garbling). http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_09.jpg === 4.3 Test MPUUART === The MPUUART has four serial ports; the two on top are RS232 ports (ttyACM0, ttyACM3), and the two at the bottom are RS485 ports (ttyACM1, ttyACM2). http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_56.jpg The connection correspondence between the two RS485 serial ports is: G - G A - A B - B Execute <code>lsusb</code>, and we can see VL805 and CH344Q: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_14.jpg Execute <code>ls /dev</code>, and we can see four serial ports: ttyACM0、ttyACM1、ttyACM2、ttyACM3: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_34.jpg We use a serial cable to connect two of the RS232 serial ports and perform data transmission tests using CuteCom. According to the tests, under the Ubuntu OS, the baud rate can reach up to 1.26 Mbps (based on data transmission without garbling). http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_16.jpg We use a serial cable to connect two of the RS485 serial ports and perform data transmission tests using CuteCom. According to the tests, under the Ubuntu OS, the baud rate can reach up to 1.98 Mbps (based on data transmission without garbling). http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_17.jpg === 4.4 Test 4G module === The CM4 4G mini module provided by our company is driver-free, does not require dialing, and is automatically recognized with plug-and-play functionality under the Ubuntu OS. You need to insert a mobile SIM card (4G or above) and connect the antenna. The 4G models include CM4 4G mini (CAT4 4G), Qualcomm 4G, Qualcomm 4G-GPS. http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_63.jpg The 4G module is recognized as a device starting with "enx..." in the Ubuntu OS. Other operations with 4G, such as using AT commands, modifying IP addresses, or utilizing GPS, are the same as on the Raspberry Pi OS. These will not be repeated here. After starting Ubuntu OS, execute <code>lsusb</code>, as shown in the following image: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_65.jpg http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_79.jpg Execute <code>ifconfig -a</code>, and we can see that the 4G module (enx...) has correctly obtained an IP address. http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_67.jpg http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_80.jpg The status of Status LED: '''CAT4 4G:''' The blinking pattern, where the light is on for 1.8 seconds and off for 0.2 seconds (alternatively, you can judge by the light being on longer than it is off), indicates that the 4G module has connected to the network. The blinking pattern, where the light is off for 1.8 seconds and on for 0.2 seconds, indicates that there is an issue with the SIM card or the network. Please check the SIM card and the antenna. '''Qualcomm 4G:''' If the LED is blinking slowly with occasional rapid flashes in between, it indicates that the 4G module has connected to the network. Otherwise, it suggests there might be an issue with the SIM card or the network; please check the SIM card and the antenna. After the 4G module correctly obtains an IP address, we can ping an external web address, such as: <code>ping www.mcuzone.com</code> http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_69.jpg You can also connect to the external network through the 4G module and visit a [https://www.speedtest.cn/ speed test website] to measure the speed: http://www.mcuzone.com/wiki/3101_Domestic_4G/3101_Domestic_4G_31.jpg '''''Note: Network speed tests are affected by the network environment and testing methods. Please refer to the actual speed, as this test is for reference only.''''' == '''V. Optional Features''' == http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_81.jpg {{Contact_Us_icon}} [http://wiki.mcuzone.com/index.php?title=0012_MPUUART_MP4232%EF%BC%88%E5%A4%9A%E8%B7%AF%E4%B8%B2%E5%8F%A3%E6%89%A9%E5%B1%95%E6%9D%BF%EF%BC%89&veaction=edit T]
本页使用的模板:
模板:Contact Us icon
(
查看源代码
)
返回
0012 MPUUART/MP4232 EN
。
开关有限宽度模式