How to make an adapter cable/board for DJI M300 RTK OSDK interface
25432 37 2020-7-6
Uploading and Loding Picture ...(0/1)
o(^-^)o
Xiao Long
lvl.2

Hong Kong
Offline

About how to connect and use the DJI M300 RTK OSDK API interface,
after groping and summing up some experience,
here is a summary to help you quickly use the M300 OSDK~


1. Interface changes

   The OSDK API interface of DJI M300 RTK has changed significantly compared to M210
   First:       the position is switched from the tail of the aircraft to the top of the aircraft
   Second:  the interface changed from the H2.54mm pin header interface to the USB TypeC interface


2. How to use the new OSDK API interface?

   The first way
   Direct purchase of DJI's official OSDK adapter board,   Product manuals  https://dl.djicdn.com/downloads/matrice-300/20200617/OSDK_Expansion_Module_Product_Information.pdf     
   as shown below
    4.png
   According to the OSDK official website document description, one end of this adapter board is a USB Type-C interface, which is used to access the OSDK interface on the M300.
   The other end to the OSDK UART interface, OSDK USB interface, XT30 power supply interface, and other expansion interfaces (there is no definition on the official website at present).
   But We can't buy this adapter yet. I have contacted DJI. This product has not been officially launched in the DJI mall, but it can be expected that it will be officially launched at the end of July or early August.

  The second way

  Make OSDK extension cable/board by yourself!
  In fact, don't worry about can not buying the official OSDK adapter, we can make and design by ourselves.
  Because the DJI official has given the M300 RTK OSDK interface definition, you can refer to the description of the official OSDK documentation   
  Documentation link: https://developer.dji.com/document/1bb1b2dc-9694-4d6b-ad43-fa69c5a10400
   5.png

3. How to DIY OSDK interface adapter cable/board?


    1. Understand TypeC interface
    The DJI M300 RTK OSDK API interface uses the USB Type C interface standard
    But it should be noted that the interface on the aircraft is a male plug!
    So you have to buy a USB Type C female plug!        The connection type is USB Type C 24 PIN female plug
    The cable can use a 24PIN copper conductor, four pairs of power lines rated current > 5A.

    2. Understand the interface definition
    As shown in the following figure, based on the direction of the drone's progress    7.png
    The A1 -> A12 is defined on the outside of the drone

    And B12 -> B1 is defined on the inside of the drone.
      8.png

    3. Circuit connection diagram
     
    1.png
      Be careful:
      1. The VCC of USB and UART cannot be connected to VCC, because the VCC is 24V and can be set to dangling status
      2. The B6 pin must be set to dangling status, it seems to be related to the USB ID
      3. The B7 pin and B8 pin must be connected to the GND, it seems to be used to detect OSDK device and USB devices
      4. It is recommended to use all eight pins of GND and VCC to ensure the power supply and stability
      5. Other pins that are not marked in the figure, can be set to dangling status if not used
      6. OSDK Type C interface is directional. Once the line sequence is defined, it cannot be connected in reverse.
          The corresponding connector can also be designed according to the anti-reverse installation structure (three spikes) of the OSDK interface.
       7. Rated current requirement of four pairs of power lines > 5A

4. How to quickly test and verify?

     I bought a USB TypeC female puls test board on the electronic mall.
     Then connect the UART and USB interface with Dupont cable, and can directly start development and use! !
      
3.png
      Hope this helps!

















2020-7-6
Use props
avashist
lvl.2

United States
Offline

Thanks for this, it helps.
2020-7-7
Use props
avashist
lvl.2

United States
Offline

Hey, quick question, do I need both USB and UART osdk connected with the onboard combuter or just using the OSDK UART should work ?
Also you show that usb-c A5(UART-RX) is connected to the RX of the UART and A8 (UART-TX) to TX od osdk UART, shouldn't it be the other way like Tx-RX and Rx - Tx ? like they mentioned in the document.

Also I have attached my image of the cable that I made, connections:

A5 - RX of usb-ttl
A8 - TX of usb-ttl
A12- ground
B7, B8 - ground


enabled api on dji assistant, only using the UART osdk connection, no usb osdk for now
dialout and djidevive rule.d are set

But when I connect with the drone and the jestson I am see the error: Drone version not obtained

IMG_2454.jpeg
2020-7-8
Use props
Responder Air
lvl.4
United States
Offline

avashist Posted at 7-8 05:50
Hey, quick question, do I need both USB and UART osdk connected with the onboard combuter or just using the OSDK UART should work ?
Also you show that usb-c A5(UART-RX) is connected to the RX of the UART and A8 (UART-TX) to TX od osdk UART, shouldn't it be the other way like Tx-RX and Rx - Tx ? like they mentioned in the document.

Thanks for the diagram, I seem to recall something about USB needing diodes or something to make usb sensing work? You using raspbian on the pi or jetson @xiao
2020-7-8
Use props
avashist
lvl.2

United States
Offline

Responder Air Posted at 7-8 12:16
Thanks for the diagram, I seem to recall something about USB needing diodes or something to make usb sensing work? You using raspbian on the pi or jetson @xiao

Hey I am using Jetson TX2 for the onboard device, and having issues with establishing the connection: shown below. Let me know if you can point to a possible solution.

2020-7-8
Use props
Xiao Long
lvl.2

Hong Kong
Offline

avashist Posted at 7-8 05:50
Hey, quick question, do I need both USB and UART osdk connected with the onboard combuter or just using the OSDK UART should work ?
Also you show that usb-c A5(UART-RX) is connected to the RX of the UART and A8 (UART-TX) to TX od osdk UART, shouldn't it be the other way like Tx-RX and Rx - Tx ? like they mentioned in the document.

For the first question, the RX and TX pin on my diagram do not exchange because it is not directly connected to the OSDK device, but as an extension interface, TX-RX exchange is needed when accessing the OSDK device.
2020-7-8
Use props
Xiao Long
lvl.2

Hong Kong
Offline

avashist Posted at 7-8 05:50
Hey, quick question, do I need both USB and UART osdk connected with the onboard combuter or just using the OSDK UART should work ?
Also you show that usb-c A5(UART-RX) is connected to the RX of the UART and A8 (UART-TX) to TX od osdk UART, shouldn't it be the other way like Tx-RX and Rx - Tx ? like they mentioned in the document.

In addition, THE DJI M300 needs to connect USB and UART pins at the same time, only connect one that cannot work normally.
2020-7-8
Use props
Xiao Long
lvl.2

Hong Kong
Offline

avashist Posted at 7-8 14:20
Hey I am using Jetson TX2 for the onboard device, and having issues with establishing the connection: shown below. Let me know if you can point to a possible solution.

[view_image]

See your log doesn't seem to have filled in the TTY device name correctly in UserConfig.txt, such as ttyUSB0, ttyACM0
2020-7-8
Use props
avashist
lvl.2

United States
Offline

Xiao Long Posted at 7-8 20:35
See your log doesn't seem to have filled in the TTY device name correctly in UserConfig.txt, such as ttyUSB0, ttyACM0

Thanks again, but I think this will clear the question I had in mind.

In the image below is the USB-ttl FTDI cable, here the usb part is connected to my onboard device and the UART( Tx, Rx) part is connected to the usb-c female plug.

So that I don't misunderstand you, the TX, RX part of the TTL wire should be connected to the corresponding TX, RX of the usb-c plug ? (like Txto Tx and Rx to Rx)



Second: in my config file I used the correct name ttyUSB0 and I think the terminal log this as an example as I am not using the ttyACM port to connect the drone with the onboard device. Now I will try to connect the usb osdk connection  along with the UART connection and will update my post if that works. :-)

Best,
2020-7-9
Use props
Xiao Long
lvl.2

Hong Kong
Offline

avashist Posted at 7-9 06:34
Thanks again, but I think this will clear the question I had in mind.

In the image below is the USB-ttl FTDI cable, here the usb part is connected to my onboard device and the UART( Tx, Rx) part is connected to the usb-c female plug.


As for the connection method between TX and RX, I have updated the diagram.
2020-7-9
Use props
avashist
lvl.2

United States
Offline

Thanks it was a great help. I got it working successfully now. I will post my solution for others to find it useful.
2020-7-10
Use props
djiuser_DQ6yKqSBPDyz
New

Denmark
Offline

Hi, the board is not available in my region. So i would like to know how did you get the USB to be detected as an ACMx? I am currently successfully connecting and obtain telemetry over the UART, but can't get the USB to work. I tried connecting the D+ D- over a second TTL, but without any success. Where by trying to connect the D+/D-/GND cables directly to a USB cable doesn't seems to work, since i can't detect a new USB device.

I get this error:
ERRORLOG/1 @ initVehicle, L222: Failed to initialize ACM Linker channel!
2020-8-4
Use props
eat fish
lvl.2
Flight distance : 8573 ft
Hong Kong
Offline

djiuser_DQ6yKqSBPDyz Posted at 8-4 06:06
Hi, the board is not available in my region. So i would like to know how did you get the USB to be detected as an ACMx? I am currently successfully connecting and obtain telemetry over the UART, but can't get the USB to work. I tried connecting the D+ D- over a second TTL, but without any success. Where by trying to connect the D+/D-/GND cables directly to a USB cable doesn't seems to work, since i can't detect a new USB device.

I get this error:

the ACM device detected the connections of USB connections as :
suggest you check with "ls -l | grep ttyACM*" after the hardware connections and comfirm the UserConfig.txt acm_port name should be the same as the detected name.
adapter.png
2020-8-9
Use props
carlosbh8
lvl.2

Colombia
Offline

Hi, I recently used the this plug to have the 24V power but it only shows 0.84V, I don't need to use USB and UART communication, only the power from the drone. What could I be doing wrong? Thanks a lot.
2020-8-31
Use props
Brad - 8
lvl.2
Flight distance : 759327 ft
Canada
Offline

carlosbh8 Posted at 8-31 15:46
Hi, I recently used the this plug to have the 24V power but it only shows 0.84V, I don't need to use USB and UART communication, only the power from the drone. What could I be doing wrong? Thanks a lot.

I am having the same issue, 0.84V. Did you work this out? If I solve this problem I'll comment back here with my solution.
2020-9-21
Use props
Nick Anderson
lvl.1

South Africa
Offline

avashist Posted at 7-10 06:06
Thanks it was a great help. I got it working successfully now. I will post my solution for others to find it useful.

Hi avashist and DJI community,

I'm struggling to get this board to work, and I'm hoping you can help! Did you ever post your solution?

I have wired up the breakout board as described in this forum, but currently:
- No data is being transmitted on the Tx UART pin (checked in bash with the "cat" command)
- The USB-A connection isn't coming up as a device on my compute device (ttyACM0)
- The breakout board has 24V on the VCC pins, and is ground on the GND pins, which suggests it's connected to the OSDK USB-C port correctly.  
- We've tested our cables and they work.

Please see the images below of our hardware setup.
I've shown the USB and UART interface connections seperately below for ease of looking. In reality, we are connecting them at the same time.

Do you have any suggestions to help debug the problem? Should I see UART data being transmitted even if the USB-A interface is not connected?
Is it possible that the USB-C polarity is incorrect? USB-C polarity is something I really don't understand.


We are using a USB-C female to USB-C male cable to access the OSDK port.

We are using a USB-C female to USB-C male cable to access the OSDK port.

The UART connection (USB-ttl FTDI cable)

The UART connection (USB-ttl FTDI cable)

The USB-A connection

The USB-A connection
2020-10-12
Use props
avashist
lvl.2

United States
Offline

Nick Anderson Posted at 10-12 22:30
Hi avashist and DJI community,

I'm struggling to get this board to work, and I'm hoping you can help! Did you ever post your solution?

Hey Nick,

In my setup, I am not using the power output from the drone osdk interface for the onboard device (Jetson TX2) for now. But I've the data communication working between the drone and the onboard-device.

Before I write a long post, I would like to get some more information from your side. Can you post the terminal screenshot of the error that you are getting when you launch the osdk ?
2020-10-14
Use props
Nick Anderson
lvl.1

South Africa
Offline

avashist Posted at 10-14 09:33
Hey Nick,

In my setup, I am not using the power output from the drone osdk interface for the onboard device (Jetson TX2) for now. But I've the data communication working between the drone and the onboard-device.

Hi avashist,

Thanks for the prompt response! I really hope you can help us get the data communication working.
We are also using an external power supply for the onboard device (Jeston Xavier NX) for now.

The terminal output is the same as yours above:


2020-10-18
Use props
avashist
lvl.2

United States
Offline

Nick Anderson Posted at 10-18 01:28
Hi avashist,

Thanks for the prompt response! I really hope you can help us get the data communication working.

some suggestions that can help you:

1) Connect the other osdk port on the drone with the usb-c to usb-a connection with another computer (linux or windows) and launch the DJI Assistant-2 for matrice app. At, this point when you switch on the drone and the RC controller, in the app make sure to check the enable API access and set the baud rate.

2)  Now switch the drone and RC controller off. Connect your interfacing cable, for now just use the usb-ttl connection (once this get working then use the ACM linker usb-a cable).  connect with the jetson and the drone and start the Drone, RC controller and the assistant app on the separate computer.

Make sure the user config file has the same Baud rate that you set  in the app in step 1. the app id and the enc key are also what you would have created on the dji website.

Then, run the osdk on jetson, IF you see the same error on the terminal. CAN you WRITE down (I know you posted pictures of the connection, but if you tell me the exact name of pins/wire connected it will help me better) the pin name and the connection with the usb-c female plug for me to quickly review it. Like what pin number on usb-c feamle connected to what pin (wire) on the usb-ttl wire. It will help me to check if the you are missing any connection or not (ignore th other usb-a connection for the ACM linker for now)

Best,
2020-10-20
Use props
HV_Sparks
lvl.2
Flight distance : 732267 ft
United Kingdom
Offline

Hi,

I am looking to get 11V-16V to power an external Ping 1090i ADS-B transceiver - would anyone be able to advise how to do this please from the USB-C?

Many thanks.
2020-10-21
Use props
carlosbh8
lvl.2

Colombia
Offline

carlosbh8 Posted at 8-31 15:46
Hi, I recently used the this plug to have the 24V power but it only shows 0.84V, I don't need to use USB and UART communication, only the power from the drone. What could I be doing wrong? Thanks a lot.

Hi, I was able to have the 24V configuration by selecting the upper camera in the remote controller. But now I have another M300, and it is not working. Only have 0.8V.
2020-10-22
Use props
djiuser_Iw3TEaRnETtE
New
Canada
Offline

carlosbh8 Posted at 10-22 12:35
Hi, I was able to have the 24V configuration by selecting the upper camera in the remote controller. But now I have another M300, and it is not working. Only have 0.8V.

Have you found out what the issue was? I'm experiencing the same thing
2020-11-2
Use props
CHETI
lvl.2
Flight distance : 9378232 ft
  • >>>
Australia
Offline

Hi, I'm wondering if it would be easy to power and control a servo drop unit via SDK?

I am also looking into powering an onboard liquid pump that would require switching on and off.

Is this something realistically possible to develop?

Sorry for the novice questions, I am very new to all this.

Thanks
2020-12-15
Use props
djiuser_VwgkfugqHBud
lvl.1

United States
Offline

Responder Air Posted at 7-8 12:16
Thanks for the diagram, I seem to recall something about USB needing diodes or something to make usb sensing work? You using raspbian on the pi or jetson @xiao

Does the USB need diodes to work? I have been unable to get the drone to connect via the USB. I am using an UP board which uses Ubilinux 4.0 (based on debian stretch) as the OS.

Is there a reasonably easy explanation for the configuration of these diodes?


The output of 'dmesg' after M300 is powered on and connected to companion computer via USB:

[  294.415467] usb 1-4: new high-speed USB device number 12 using xhci_hcd
[  294.556923] usb 1-4: New USB device found, idVendor=2ca3, idProduct=001f
[  294.556931] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  294.556936] usb 1-4: Product: e1e
[  294.556940] usb 1-4: Manufacturer: DJI
[  294.556943] usb 1-4: SerialNumber: 123456789ABCDEF
[  294.748693] cdc_acm 1-4:1.4: ttyACM0: USB ACM device
[  294.751070] usbcore: registered new interface driver cdc_ether
[  294.753329] usbcore: registered new interface driver cdc_acm
[  294.753332] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[  294.758610] rndis_host 1-4:1.0 usb0: register 'rndis_host' at usb-0000:00:15.0-4, RNDIS device, 3e:ce:ed:16:41:da
[  294.758663] usbcore: registered new interface driver rndis_host
[  294.765709] rndis_host 1-4:1.0 enp0s21f0u4: renamed from usb0
[  294.770315] usb-storage 1-4:1.2: USB Mass Storage device detected
[  294.770429] scsi host2: usb-storage 1-4:1.2
[  294.771475] usbcore: registered new interface driver usb-storage
[  294.774167] usbcore: registered new interface driver uas
[  294.786861] IPv6: ADDRCONF(NETDEV_UP): enp0s21f0u4: link is not ready
[  295.788681] scsi 2:0:0:0: Direct-Access     Linux    File-Stor Gadget 0409 PQ: 0 ANSI: 2
[  295.789385] scsi 2:0:0:1: Direct-Access     Linux    File-Stor Gadget 0409 PQ: 0 ANSI: 2
[  295.964526] scsi 2:0:0:0: Attached scsi generic sg0 type 0
[  295.964666] scsi 2:0:0:1: Attached scsi generic sg1 type 0
[  295.971717] sd 2:0:0:0: [sda] Attached SCSI removable disk
[  295.971958] sd 2:0:0:1: [sdb] Attached SCSI removable disk
[  298.872434] usb 1-4: USB disconnect, device number 12
[  298.872756] rndis_host 1-4:1.0 enp0s21f0u4: unregister 'rndis_host' usb-0000:00:15.0-4, RNDIS device
[  298.889965] cdc_acm 1-4:1.4: acm_ctrl_irq - usb_submit_urb failed: -19
[  299.020263] cdc_acm 1-4:1.4: failed to set dtr/rts
2020-12-22
Use props
CHETI
lvl.2
Flight distance : 9378232 ft
  • >>>
Australia
Offline



I can only manage to detect 0.8V at A4, A9, B4 and B9 as well. How do you get 24V??
Thanks
2021-1-2
Use props
habahaba
lvl.2
Flight distance : 365948 ft
Poland
Offline

Can I use a standard USB C extension cable (1-2m) with the DJI Matrice 300 Single Upward Gimbal Connector?
2021-3-30
Use props
spindlemonkey
New

United Kingdom
Offline

Sorry guys - realise its a bit of an old thread - but has anybody got any advice on the power from the port thing ?

i dont need coms or uart or ttl etc etc .. id just like to get more than 5v from the usb ports/osdk port ... ive only tried so far without the transmitter turned on .. and just powering up the unit ... and i get 5v (using a power negotiator circuit) on the bottom single USB port ... nothing on the bottom front two apart from a carrier voltage of about 1.65v .. and nada from the top ports at all .... thats a lie .. i think i got .8v from the top usb port .. but nothing from the osdk ...do they need activating/switching on via the transmitter perhapse? ... is it a case of using a usb c  breakout board and just hooking up to vcc and ground ... would be very grateful for any advice. thanks
2021-6-3
Use props
Drone Inspect
lvl.2
Flight distance : 204554 ft
United Kingdom
Offline

We are also trying to obtain the pinout for +v and GND on the Payload USB (we need to power a payload off the drone for data processing) Cannot find anything on this, so does anyone here know the Pins on the USB C connector for Payload ports (Lower ports) I think it should be around 13v
2021-12-17
Use props
djiuser_hfC7e91bvlrX
lvl.1

United States
Offline

Just a wild guess, to get the 24 V from the osdk port maybe you need to activate the osdk tool in the assistant 2 app to turn on the port functions. Can someone try this and let me know if it worked?
2022-1-12
Use props
soham
lvl.1

India
Offline

Hi! With our setup I am able to get data on the UART port but my machine wouldn't detect the USB connection. I don't see any /dev/ttyACM*. How could we resolve this? Is there any software configuration that needs to be done?
2022-1-21
Use props
robert300
lvl.1

Belgium
Offline

soham@flytbase Posted at 1-21 00:33
Hi! With our setup I am able to get data on the UART port but my machine wouldn't detect the USB connection. I don't see any /dev/ttyACM*. How could we resolve this? Is there any software configuration that needs to be done?

I'm facing the same issue. The USB connection shows nothing in my dmesg list. I'm even using the official DJI OSDK expansion module.
Were you able to solve this issue?
2022-4-8
Use props
djiuser_mtkgcs9qABHM
lvl.1

United States
Offline

soham@flytbase Posted at 1-21 00:33
Hi! With our setup I am able to get data on the UART port but my machine wouldn't detect the USB connection. I don't see any /dev/ttyACM*. How could we resolve this? Is there any software configuration that needs to be done?

I am having the same problem with a M300 rtk - I can use ttyusb0 for UART but my laptop won't even detect a the USB 2.0 (ttyacm0) when I plug it in and use the lsusb command. Did you figure it out? Any help is appreciated.


2022-5-20
Use props
djiuser_mtkgcs9qABHM
lvl.1

United States
Offline

robert300 Posted at 4-8 06:48
I'm facing the same issue. The USB connection shows nothing in my dmesg list. I'm even using the official DJI OSDK expansion module.
Were you able to solve this issue?

I am having the same issue - were you able to figure this out?
2022-5-20
Use props
djiuser_0XmkZriQb7jo
lvl.1
Flight distance : 2787198 ft

Spain
Offline

Is it possible DJI had inverted the OSDK pinout and now B1-B12 is outside and A1-A12 inside?
2022-6-26
Use props
jackwilth
lvl.1

Jordan
Offline

hi i need help i have matrice 300 upper fan error
2022-8-2
Use props
djiuser_bMXaQh8mffV4
lvl.2

Brazil
Offline

djiuser_VwgkfugqHBud Posted at 2020-12-22 11:38
Does the USB need diodes to work? I have been unable to get the drone to connect via the USB. I am using an UP board which uses Ubilinux 4.0 (based on debian stretch) as the OS.

Is there a reasonably easy explanation for the configuration of these diodes?

Did someone makes the USB 2.0 communication works? My ACM0 do not appear following the board instructions.  ACM linker channel do not connect and i cant get camera images.
2022-10-6
Use props
djiuser_e263sFGWY5xw
New

United States
Offline

Do you know what pins need to be grounded when trying to interface with a PSDK port on the bottom of the M300? For instance, pins B7 and B8 must be grounded for the OSDK port. Are there different pins that need to be grounded for the PSDK port? I tried to used the expansion board I made for the OSDK port with the PSDK port, but it's not looking like the port recognizes the female USB C (it's not giving 17 volts). Thanks!
2023-5-14
Use props
CarlosTMorgan
New

Pakistan
Offline

Creating an adapter cable or board for the DJI M300 RTK OSDK interface involves defining requirements, selecting components, designing schematics, prototyping, manufacturing, testing, and ensuring compliance and safety. Consult experts for complex projects.




2023-10-23
Use props
Advanced
You need to log in before you can reply Login | Register now

Credit Rules