Recently, we have received many inquiries from developers about model connection. The connection method introduced in the official document is a flowchart, without any physical object, so it may not look particularly intuitive. Therefore, we have supplemented the connection method of common PSDK models based on the introduction in the official document, with pictures and videos to help everyone understand how to connect. If you have any questions, please leave a message for discussion or consult dev@dji.com for further information.
Video introduction (for M350, M3/T, M30/T, M3D/TD models, please refer to the M350*.mp4 video file):
https://pan-sec.djicorp.com/s/mYbBPJ7pDHdjAKZ
M300 connection:
Note: It is recommended to confirm the position of the dip switch before turning on the aircraft power, otherwise the port may not be correctly identified. Each time the dip switch position of the master and slave roles is switched, the coaxial cable on the aircraft side needs to be re-plugged to allow the aircraft to re-identify.
1. Make sure that the AA and BB sides of the coaxial cable do not appear at the same time. The combination can be AB or BA.
2. The serial port connection diagram uses USB-TTL. It is recommended to use the FT232 chip, which has better compatibility and stability.
3. Connect the aircraft and expansion board with the coaxial cable. Here we use side A facing the direction of the power button inside the aircraft and side B facing outward. For the expansion board, side B faces upward and side A faces downward.
4. Check whether the power switch is turned on. There is a dip switch next to the coaxial cable, turn it to NO.
5. On the other end of the expansion board, there is a Type C port and a dip switch next to it, turn it to the Device side.
6. Use a Type C data cable to connect the Type C port of the expansion board and the USB A port of the development board. (It can be a mobile phone data cable. The cable must have data transmission function. It cannot be a simple power cable. The cable will be used as a data exchange link by the PSDK program.)
7. After confirmation, connect the coaxial cable to the aircraft and power on the aircraft. Use the command ls /dev/tty* to view the port on the development board. You can see /dev/ttyACM0 and /dev/ttyUSB0 appear (if multiple serial ports are connected to the development board, you can confirm it by hot-plugging USB-TTL). These two are the connections of the USB cable and USB-TTL respectively. The appearance of these two ports indicates that the hardware connection is fine. The specific PSDK program can be configured in conjunction with the article How to configure the serial port in PSDK.
https://sdk-forum.dji.net/hc/zh-cn/articles/23167491159449-PSDK%E5%A6%82%E4%BD%95%E9%85%8D%E7%BD%AE%E4%B8%B2%E5%8F%A3%E7%AB%AF%E5%8F%A3
In the hal_uart.h file of the corresponding project, there are DEV1 and DEV2, and DEV2 is generally configured as ACM0.
Connection method for M350/M30/M3/M3D models:
Since they are all E-Port interfaces, we take the M350 model as an example, and the remaining models can be connected in this way:
1. For the part of the coaxial line connected to the aircraft, do not have the AA and BB sides facing up at the same time. Here we use the A side facing the direction of the aircraft power button and the B side facing outward. On the expansion board side, the B side faces up and the A side faces down. The serial port uses USB-TTL for connection.
2. Check the DIP switch next to the coaxial cable and make sure it is on the ON side.
3. Here we use a double-headed Type C data cable to connect the expansion board and the development board. Our demonstration board is the Raspberry Pi 4B. The Type C cable can power the Raspberry Pi and transmit data.
Confirm the position of the dip switch next to the Type C interface. It needs to be dialed to the Host side. If it is the Device side at the beginning, it needs to be switched. At this time, you can not connect the aircraft first, and first confirm that the line connection is correct.
4. The overall connection is as follows. The necessary connections are USB-TTL and Type-C cables. You don't need to refer to the rest. There are two E-Port expansion boards in the picture. You can refer to the expansion board on the upper right for connection. The expansion board on the top of the Raspberry Pi is an integrated homemade hardware connection. In addition, a USB network card is connected to the Raspberry Pi because remote debugging is required.
The development board interfaces used by some developers may be different. This mainly depends on which interface the development board uses to connect to the aircraft as a slave device. The Type C interface of the Raspberry Pi allows it to be used as a device and also as a power supply port.
For example, the Miaosuan 2G uses a Micro USB interface to connect it as a slave device. The connection should be a Micro USB cable + Type C OTG cable to connect the E-Port expansion board, as shown below.
5. After the connection is completed, use ls /dev/tty* on the development board, you can see USB0 display, which means the serial port has been successfully connected. M350/M3/M30/M3D models only need this port, and do not need ACM0 port.
The remaining part needs to configure USB-BULK to complete the communication
树莓派4B配置USB device RNDIS 和 BULK
6. The USB-BULK link requires a certain understanding of your own development board and a certain familiarity with the LINUX operating system to configure it. Debugging will be involved in the process. Due to the differences in development boards and platforms, the problems encountered in configuration may be different or strange. In addition to the M3D/TD models, we recommend that the M350 M30 M3 models can be connected using a USB network card. Note: M300 does not support network. After ACM0 appears in the normal connection, set the link to uart&bulk in dji_sdk_config.h.
The USB network card models we support are AX88179A and RTL8152. Other models are not supported yet.
Connection method:
The Uart serial port connection remains unchanged, E-Port expansion board -> OTG cable -> USB network card -> network cable -> development board.
Then you can modify the link to uart&network in the dji_sdk_config.h file. At the same time, modify the port number in the hal_network.h file (which can be viewed through ifconfig), and check the VID PID. If you don’t know the VID PID information, you can first connect the USB network card to the development board and use lsusb to view it.
Then the corresponding hal_network.h file
These two configurations are switched according to the architecture. If you are not sure about the platform architecture, you can use the uname -a command to confirm.
Common Problems:
1. If a serial port error occurs:
Try to identify UART0 connection failed. Probably because SDK adapter or aircraft not finish init or UART connect error.
You can check whether there is a USB0 port under /dev/tty*. Some developers use the onboard serial port. At this time, you can try to replace USB-TTL (FT232) and then connect. If there is a USB0 port, you can use chmod to modify the permissions, or sudo to execute the PSDK program.
2. After following the connections in the picture or video, the ACM0 port does not appear. Note: The ACM0 port only needs to be configured for the M300 model, and other models only need the USB0 port. If the M300 model does not have the ACM0 port, you can first unplug the coaxial cable connected to the aircraft, unplug the Type C cable between the expansion board and the development board, and then connect the aircraft coaxial cable first. After confirming that the power light of the expansion board is on, connect the Type C cable between the expansion board and the development board, and then check again whether the ACM0 port appears.
Comments
0 comments
Please sign in to leave a comment.