MOP Channel Issues with M350 Drone and Jetson Orin Nano via E-Port

Completed

Comments

8 comments

  • Tmay

    after some initial research it seems a "Full Featured" usb cable might be needed.
    Here is so more information on my problem, I continue update the thread with anything I think can help solve the issue.

    When I connect the  drone I do see usb0. I am trying to bridge it and I am able to ping the m350 at 192.168.44.3 from the command line and I do believe that would be the the drone's rndis host.

    So maybe, I have the bulk usb set up incorrect?

    I do have the start up bulk script running and I have confirmed that the usb_gizmo settings have been setup



    root         825       1  0 14:18 ?        00:00:00 /home/terry/startup_bulk/startup_bulk /dev/usb-ffs/bulk1
    root        1478       1  0 14:18 ?        00:00:00 /home/terry/startup_bulk/startup_bulk /dev/usb-ffs/bulk2
    terry       4794    3422  0 14:59 pts/0    00:00:00 grep --color=auto bulk



    my bulk settings (I am on a jetson Orin Nano Dev kit)

    #define LINUX_USB_BULK1_EP_OUT_FD "/dev/usb-ffs/bulk1/ep1"

    #define LINUX_USB_BULK1_EP_IN_FD "/dev/usb-ffs/bulk1/ep2"

    #define LINUX_USB_BULK1_INTERFACE_NUM (2)

    #define LINUX_USB_BULK1_END_POINT_IN (0x83)

    #define LINUX_USB_BULK1_END_POINT_OUT (2)

    #define LINUX_USB_BULK2_EP_OUT_FD "/dev/usb-ffs/bulk2/ep1"

    #define LINUX_USB_BULK2_EP_IN_FD "/dev/usb-ffs/bulk2/ep2"

    #define LINUX_USB_BULK2_INTERFACE_NUM (3)

    #define LINUX_USB_BULK2_END_POINT_IN (0x84)

    #define LINUX_USB_BULK2_END_POINT_OUT (3)

    #ifdef PLATFORM_ARCH_x86_64

    #define LINUX_USB_VID (0x0B95)

    #define LINUX_USB_PID (0x1790)

    #else

    #define LINUX_USB_VID (0x0955)

    #define LINUX_USB_PID (0x7020)

    #endif


    and of course in the config
    /*!< Attention: Select your hardware connection mode here.

     * */
    #define CONFIG_HARDWARE_CONNECTION DJI_USE_UART_AND_USB_BULK_DEVICE




    when I run the application I wait before I trigger the mop_init
    and then after the mop_init I wait 45 secs
    here's the typical log:

    mop channel handle create for id:49152
    mop handler created for id: 49152
    starting Accepting Connections
    mop channel Init
    Pausing for 45 seconds...
    Resuming execution.
    mop channel set normal send task
    mop channel set recv normal task
    mop channel File Service task
    [144.464][channel]-[Error]-[DjiMopChannel_Accept:555) Operation is not supported in current state. Suggestion : Please try again later.

    [144.464][user]-[Warn]-[DjiTest_MopChannelFileServiceAcceptTask:421) [File-Service] mop accept channel error :0x000000E4

    mop accept channel error 228channel: 0xffff4c000b60

    [144.464][channel]-[Error]-[DjiMopChannel_Accept:555) Operation is not supported in current state. Suggestion : Please try again later.
    0
    Comment actions Permalink
  • Tmay

    I said "usb_gizmo" but I meant "usb_gadget" ^ up there ^ 
    it's the config that gets written into `/sys/kernel/config/usb_gadget/l4t/`

    0
    Comment actions Permalink
  • Tmay

    My thoughts keep going back to this 
    "USB 2.0 (USB bulk transfer) or Rndis (TCP/IP over USB) functions, we should use the USB_DP pin (B6) and USB_DM pin (B7)."

    does this mean I need to use a full featured c to c cable that connects to the usb-c port on the orion nano?
    which leads to more questions, do I then need to change the configuration of the Orin Nano's usb-c port. 
    Because I when try to connect to it, nothing happens.  I'll check my udev rules, but if anyone out there reading this has any inking about this, please just give a minute to confirm some real facts for me, it would help me lower my blood pressure.

    0
    Comment actions Permalink
  • Tmay

     I have ordered a C to C OTG cable to try with the Orin's usb C Port. I will report back to this thread and leave future readers hanging.

    0
    Comment actions Permalink
  • DJI Developer Support
    Dear Developer, Hello, thank you for contacting DJI. Thank you for your patience, we have just returned from the Spring Festival holiday. Your description may not be complete according to our system, so I went to the forum to check all the information you described. There may be the influence of translation software in this process. I'm sorry if I misunderstood your meaning or description. We would like to sort out your attempts and operations with you. Before that, we would like to explain to you that you can use l4tbr0 as a NETWORK link to connect, which also supports the MOP function and does not necessarily require a BULK link. In order to successfully conduct MOP communication, you need to connect your device to the M350 model as a slave device. (If you are not sure whether your device has been used as a slave device, you can connect it to your computer and use the device management option to check whether your device has been used as a slave device. Connect) M350 model as the master device. Do you have an E-Port development kit around you? The development kit we provide is to enable your device to switch between master and slave and connect to the aircraft smoothly. If there is no development kit, you need to design the hardware by yourself. I see that you have configured BULK1 and BULK2, which can be queried through the ps command. We recommend that you follow the test procedure at the end of this article to test whether there is any problem with the data sending and receiving of the corresponding port (that is, the port you configured in hal_usb_bulk.h) , since the article is written in Chinese, you may need to translate it yourself. https://sdk-forum.dji.net/hc/zh-cn/articles/10232604141465-M30%E5%BC%80%E5%8F%91-%E6%A0%91%E8%8E%93%E6 %B4%BE4B%E9%85%8D%E7%BD%AEUSB-device-RNDIS-%E5%92%8C-BULK Thank you for your support of DJI products. Best Regards, DJI Dajiang innovation SDK technical support
    0
    Comment actions Permalink
  • DJI Developer Support
    Dear Developer, Hello, thank you for contacting DJI. Attached is the log when connecting to MOP normally. Hope it is of reference value to you. Thank you for your support of DJI products. Best Regards, DJI Dajiang innovation SDK technical support
    0
    Comment actions Permalink
  • Tmay

    Thank you for your response.

    I have ordered a USB-C to USB-C OTG cable.

    I did not understand the capabilites of the Jetson Orin USB bus and I did not have the correct usb cable for my device to become a SLAVE device. I am excitred to try the l4tbr0 link, thank you for the information! I fel like I am finally understanding.  I am awaiting the delivery of my cable to proceed.

    0
    Comment actions Permalink
  • DJI Developer Support
    Dear Developer, Hello, thank you for contacting DJI. We are happy to help you solve your problem. If you have any other questions, you are welcome to consult again. Thank you for your support of DJI products. Best Regards, DJI Dajiang innovation SDK technical support
    0
    Comment actions Permalink

Please sign in to leave a comment.