Any working code samples for PSDK using E-port on M350?

已完成

评论

9 条评论

  • DJI Developer Support
    The M350 E-PORT port uses UART and USB to communicate with the onboard computer, and the UART only uses LINUX_UART_DEV1, which corresponds to the E-PORT TTL pin (TX/RX/GND). The USB drone as the host ( E-PORT board switch to host), and connects to the onboard computer(USB device), There are three ways,choose one of them: 1. Connect to the USB device port (or USB OTG) of the onboard computer, and use the USB BULK channel. 2. Connect to the USB device port (or USB OTG) of the onboard computer, and use the USB RNDIS channel. 3. The E-PORT is connected to the USB network card module, and then USB network card is connected to the network port of the on-board computer through a network cable.
    0
    评论操作 固定链接
  • Josh

    Do you have any code sample for this? I am trying to configure the code at https://github.com/dji-sdk/Payload-SDK to work in any of these 3 ways and it allows me to specify LINUX_UART_DEV1 and the network but that's all I am able to do.

    Is there a way to configure the code at https://github.com/dji-sdk/Payload-SDK to work in the ways you have suggested? I am changing the macros in dji_sdk_config.h CONFIG_HARDWARE_CONNECTION but none of the options have changed anything (DJI_USE_ONLY_UART, DJI_USE_UART_AND_USB_BULK_DEVICE, DJI_USE_UART_AND_NETWORK_DEVICE). Do I need to have the e-port dev board connected to the computer with something else in addition to a USB cable?

    0
    评论操作 固定链接
  • Josh

    I have now attached a UART device and can start the connection process, but it fails with a payload negotiate error 255.

    0
    评论操作 固定链接
  • Josh

    DJI Developer Support Do you have some advice for the given error when running dji_sdk_demo_linux_cxx:

    [0.000][core]-[Info]-[DjiCore_Init:101) Payload SDK Version : V3.5.0-beta.0-build.1765
    [1.044][adapter]-[Info]-[DjiAccessAdapter_Init:186) Identify aircraft series is Matrice 350 Series
    [1.044][adapter]-[Info]-[DjiAccessAdapter_Init:206) Identify mount position type is Extension Port Type
    [1.050][adapter]-[Info]-[DjiAccessAdapter_Init:301) Identity uart0 baudrate is 921600 bps
    [3.081][adapter]-[Info]-[DjiPayloadNegotiate_Init:197) Waiting payload negotiate finish.
    [4.081][adapter]-[Info]-[DjiPayloadNegotiate_Init:197) Waiting payload negotiate finish.
    [5.081][adapter]-[Info]-[DjiPayloadNegotiate_Init:197) Waiting payload negotiate finish.
    [6.081][adapter]-[Info]-[DjiPayloadNegotiate_Init:197) Waiting payload negotiate finish.
    [7.082][adapter]-[Info]-[DjiPayloadNegotiate_Init:197) Waiting payload negotiate finish.
    [8.082][adapter]-[Error]-[DjiAccessAdapter_Init:312) Payload negotiate error, returnCode = 225
    terminate called after throwing an instance of '[8.082][adapter]-[Error]-[DjiAccessAdapter_Init:318) Payload negotiate error, returnCode = 225
    std::runtime_error[8.082][core]-[Error]-[DjiCore_Init:121) Access adapter init error, stat:225
    '
      what():  Core init error.
    Aborted

    0
    评论操作 固定链接
  • DJI Developer Support
    dji_sdk_config.h #define CONFIG_HARDWARE___CONNECTION DJI_USE_ONLY_UART Setting to only UART will only use the UART channel,and will not negotiate. If it is set to USB BULK or USB NETWORK, you need to connect USB cable, and configure USB BULK or USB RNDIS, or USB network card channel.
    0
    评论操作 固定链接
  • Josh

    This thread can be closed.

    0
    评论操作 固定链接
  • andrefilipe.moura

    Hello Josh,
    I'm facing the same problems as you did for a similar application. Can you resume what you had to do to get the UART communication to work?
    I'm still stuck at "Try identify UART0 connection failed. "

    Thanks

    0
    评论操作 固定链接
  • Flavio Perucchi

    I am stuck at the exact same position. Any help is highly appreciated. I get UART only connection to work, but not USB Bulk or USB RNDIS. I need one of both to get MOP Channel working.

    0
    评论操作 固定链接
  • atin4210

    So I finally got the Flight Control (menu option "1") and the Gimbal control (menu option "a") working with the C++ sample app for a Matrice 350 using a E-port adapter kit and the PSDK development kit with a Raspberry Pi motherboard. I'll first share just the E-port adapter and its setup to get the Flight Control part of the sample app to work. After that on another message I'll share the combination of the E-port and the PSDK port (or called the Gimbal port) setup.

    A few tips that I learned the hard way chasing down runtime errors that made no sense to me.

    1. Check that the adapter board connections (especially the USB-TTL's Gnd, Tx, Rx connectors) are secure and well connected, otherwise you will get weird errors during runtime.
    2. Also, keep all cables and the adapter board away from and not blocking any of the camera's and/or sensors all around the drone, otherwise that too can lead to weird errors of the aircraft not being able to fly.
    3. If you're house if anything like mine where I cannot get a clear RTK signal, turn of RTK, otherwise your drone will fail to take off.

    Here is my E-port development kit setup and the changes that I made to get it to work. 

     

     

    Now for the setup descriptions:

    1. The E-port on the drone is connected to the adapter board as specified in the following DJI drone connection document,
    2. The adapter board is connected to the Raspberry Pi motherboard (RPi mobo) via 2 connections: (a)  First connection: Adapter board USB-C to Ethernet adapter --> Ethernet cable to Raspberry Pi motherboard, (b) Second connection: The 3 pins on the adapter board labelled GND, TX, RX connected using a USB-TTL adapter (gnd-gnd, Rx-Tx, Tx-Rx) to the bottom USB port on the RPi mobo,
    3. The flight simulator is running on a Windows PC through the DJI Assistant 2 (Enterprise series) and the PC <-- USB-A - USB-C --> M350 USB-C port,
    4. The RC Plus controller is set to be in N-mode (there is no P-mode),
    5. The M350 has all of its arms extended and locked,
    6. Commented out all of the macros in the C++ dji_sdk_config.h file for: CONFIG_MODULE_SAMPLE_GIMBAL_EMU_ON, CONFIG_MODULE_SAMPLE_WIDGET_ON, CONFIG_MODULE_SAMPLE_WIDGET_SPEAKER_ON, CONFIG_MODULE_SAMPLE_POWER_MANAGEMENT_ON and CONFIG_MODULE_SAMPLE_DATA_TRANSMISSION_ON
    7. Commented out all of the macros in the sample_c dji_sdk_config.h file except: CONFIG_MODULE_SAMPLE_XPORT_ON and CONFIG_MODULE_SAMPLE_GIMBAL_EMU_ON
    8. Modified the dji_sdk_config.h in both the C/C++ samples to: #define CONFIG_HARDWARE_CONNECTION   DJI_USE_ONLY_UART
    9. Modified the hal_network.h file as follows:
    • Line 45:    #define LINUX_NETWORK_DEV   "eth0" // because my raspberry pi mobo has eth0 as its main network interface
    • Line 55:    #define USB_NET_ADAPTER_VID  (0x0B95)
    • Line 56:    #define USB_NET_ADAPTER_PID  (0x1790)

    I have successfully run the build/bin/dji_sdk_demo_linux_cxx sample. I have tested menu option (0) and then menu option (1) for Flight Control with the 0, 1 and 4 sub menu options.

    0
    评论操作 固定链接

请先登录再写评论。