psdk3.1 拿video时。m300可以拿到推流 相同的代码 m30却拿不到。 请问有什么限定么

Comments

19 comments

  • DJI Developer Support
    M300和M30的USB(推流和拉流)的方案有变更,M300上飞机USB端做device,机载计算机设备做host,M30上飞机端USB做host,机载计算机端USB做device。M30上开发需要将USB连接到机载计算机的USB device或OTG,配置RNDIS和BULK分别用于推流(原PSDK相机流)和拉流(原OSDK获取挂载相机视频流)。
    0
    Comment actions Permalink
  • #YUAN SHENGHAI#

    请问有配置rndis 或者bulk的说明文件么。 这里在哪可以找到

    0
    Comment actions Permalink
  • DJI Developer Support
    DJI有提供基于妙算2G(英伟达TX2)的配置脚本,此渠道不支持提供附件。麻烦您发邮件至dev@dji.com,可以通过邮件回复提供。
    0
    Comment actions Permalink
  • #YUAN SHENGHAI#

    我们是基于xavier跑的 pc的username 也是nvidia 理论上之久能跑

     

    下面的rndis 和bluk也都enable了


    cfg_str=""
    echo "enable rndis"
    # Note: RNDIS must be the first function in the configuration, or Windows'
    # RNDIS support will not operate correctly.
    if [ ${enable_rndis} -eq 1 ]; then
        cfg_str="${cfg_str}+RNDIS"
        func=functions/rndis.usb0
        mkdir -p "${func}"
        ln -fs "${func}" "${cfg}"

    。。。。。


    enable_bulk=1
    echo "enable bulk"
    if [ ${enable_bulk} -eq 1 ]; then
        mkdir -p /dev/usb-ffs
        cfg_str="${cfg_str}+BULK"
       
        mkdir -p /dev/usb-ffs/bulk
        func=functions/ffs.bulk
        mkdir -p "${func}"
        ln -fs "${func}" "${cfg}"
        mount -o mode=0777 -o uid=2000 -o gid=2000 -t functionfs bulk /dev/usb-ffs/bulk
        /home/nvidia/Desktop/startup_bulk/startup_bulk /dev/usb-ffs/bulk &
        sleep 3
    fi

     

    还是不可以 请问那里有具体的说明文档 说明如何连接到M30

     

     

    0
    Comment actions Permalink
  • DJI Developer Support
    配置文件已发送,可以参考进行配置。
    0
    Comment actions Permalink
  • #YUAN SHENGHAI#

    我们已经试过这个配置文件 可是依然不能拿到M30 推流。 请问到哪找具体的step by step instruction?

     

    0
    Comment actions Permalink
  • DJI Developer Support
    请问现在运行PSDK是否有报错? 1、先ping一下M30的IP看是否能通。可通过API获取M30的IP: DjiPayloadCamera_GetVideoStreamRemoteAddress,通常为192.168.112.1 2、代码中USB相关的注册接口要打开。 ![](https://djisdksupport.zendesk.com/attachments/token/Q1QZIuaSRbNKIUbPDVAn039rH/?name=image.png)
    0
    Comment actions Permalink
  • #YUAN SHENGHAI#

    psdk没有报错

    IP可以ping到

    USB相关的sh 和service 都有在跑

    0
    Comment actions Permalink
  • #YUAN SHENGHAI#

    [8.987][auth]-[Info]-[DjiAuth_Sha256RsaVerify:81) Application info verify successfully, ID: 118763, Key: 940d9fb1c16ffbe18fede682a34cea1 
    [8.987][core]-[Info]-[DjiCore_Init:151) Identify AircraftType = Matrice 30, MountPosition = Extension Port, SdkAdapterType = None 
    [8.987][core]-[Info]-[DjiCore_ApplicationStart:207) Start dji sdk application 
    [8.987][user]-[Info]-[DjiUser_ApplicationStart:231) Application start. 
    Ip Address: 192.168.112.1, Port: 23003

     

    nvidia@ubuntu:~/Downloads$ ping 192.168.112.1
    PING 192.168.112.1 (192.168.112.1) 56(84) bytes of data.
    64 bytes from 192.168.112.1: icmp_seq=1 ttl=64 time=0.436 ms
    64 bytes from 192.168.112.1: icmp_seq=2 ttl=64 time=0.442 ms
    64 bytes from 192.168.112.1: icmp_seq=3 ttl=64 time=0.429 ms
    64 bytes from 192.168.112.1: icmp_seq=4 ttl=64 time=0.262 ms
    64 bytes from 192.168.112.1: icmp_seq=5 ttl=64 time=0.365 ms
    64 bytes from 192.168.112.1: icmp_seq=6 ttl=64 time=0.422 ms
    ^C
    --- 192.168.112.1 ping statistics ---
    6 packets transmitted, 6 received, 0% packet loss, time 5114ms
    rtt min/avg/max/mdev = 0.262/0.392/0.442/0.063 ms
    nvidia@ubuntu:~/Downloads$ telnet 192.168.112.1 23003
    Trying 192.168.112.1...
    telnet: Unable to connect to remote host: Connection refused

     

     

    0
    Comment actions Permalink
  • DJI Developer Support
    这边拿到了一个NX平台,稍微晚点会先在NX上配置PSDK BULK+RNDIS环境,配置好会同步出来供参考。
    0
    Comment actions Permalink
  • DJI Developer Support
    这边拿到英伟达NX平台配置如下,可以正常通过bulk获取视频流。 1、nv-l4t-usb-device-mode-config.sh中仅开启 enable_rndis=1 将ACM,ECM均关闭,例如: ![](https://djisdksupport.zendesk.com/attachments/token/ooANfihrox10DR8lEgHuGQ6VD/?name=image.png) 2、nv-l4t-usb-device-mode-start.sh中添加如下部分 ![](https://djisdksupport.zendesk.com/attachments/token/cfQW2k9stdz6m24Mhjr6qFIOe/?name=image.png) 3、配置完成后,查看:ls /sys/kernel/config/usb_gadget/l4t/functions/,如下: ![](https://djisdksupport.zendesk.com/attachments/token/Ecum8kV0CJVabXVO6VpBZmTes/?name=image.png) 然后编译运行PSDK,可正常获取相机视频流。
    0
    Comment actions Permalink
  • #YUAN SHENGHAI#

    收到 明早做测试。 thx

    0
    Comment actions Permalink
  • Tan Cher Yang

    我们已经根须这些步骤了,但是还是不能获取视频流. 在 nv-l4t-usb-device-mode-config.sh已经进行以下改厕:

    # Ethernet using the RNDIS protocol.
    # Linux: Supported automatically.
    # Windows: Supported automatically via OS descriptors.
    # MacOS: Requires the HoRNDIS driver to be installed.
    enable_rndis=1
    # CDC ACM serial port/UART.
    # Linux: Supported automatically.
    # Windows 10: Supported automatically.
    # Windows other: Requires driver manual selection by use of l4t-serial.inf.
    # Mac OS: Supported automatically.
    #enable_acm=1
    # Ethernet using the CDC ECM or NCM protocol.
    #  ECM:
    #   Linux: Supported automatically.
    #   Windows: Not supported.
    #   Mac OS 10.14: Supported automatically.
    #   Mac OS 10.15: Supported on its own, but fails alongside other protocols.
    #  NCM:
    #   Linux: Supported automatically.
    #   Windows: Not supported.
    #   Mac OS 10.14: Supported automatically.
    #   Mac OS 10.15: Supported automatically.
    #enable_ecm=1
    # Ideally, we'd have separate enable_ecm and enable_ncm variables, but that
    # makes the MAC address calculcations longer, and since it doesn't make sense
    # to enable them both, we just share the ECM and NCM MAC addresses and code.
    # ECM-vs-NCM selection; pick one of the following two sets of lines; this:
    #ecm_ncm_name=NCM
    #ecm_ncm=ncm
    # or this:
    #ecm_ncm_name=ECM
    #ecm_ncm=ecm
    # USB Mass Storage (virtual disk drive/USB memory stick).
    # Linux: Supported automatically.
    # Windows: Supported automatically.
    # Mac OS: Supported automatically.
    #enable_ums=1

    在nv-l4t-usb-device-mode-start.sh也已经进行改厕:

    # Ethernet devices require additional configuration. This must happen after the
    # UDC device is assigned, since that triggers the creation of the Tegra-side
    # Ethernet interfaces.
    #
    # This script always assigns any-and-all Ethernet devices to an Ethernet
    # bridge, and assigns the static IP to that bridge. This allows the script to
    # more easily handle the potentially variable set of Ethernet devices.
    #
    # If your custom use-case requires separate IP addresses per interface, or
    # only ever has one interface active, you may modify this script to skip
    # bridge creation, and assign IP address(es) directly to the interface(s).

    if [ ${enable_rndis} -eq 1 ]; then
        /sbin/brctl addif l4tbr0 "$(cat functions/rndis.usb0/ifname)"
        /sbin/ifconfig "$(cat functions/rndis.usb0/ifname)" up
    fi

    if [ ${enable_ecm} -eq 1 ]; then
        /sbin/brctl addif l4tbr0 "$(cat functions/${ecm_ncm}.usb0/ifname)"
        /sbin/ifconfig "$(cat functions/${ecm_ncm}.usb0/ifname)" up
    fi

    enable_bulk=1

    if [ ${enable_bulk} -eq 1 ]; then
        mkdir -p /dev/usb-ffs
        cfg_str="${cfg_str}+BULK"
       
        mkdir -p /dev/usb-ffs/bulk
        func=functions/ffs.bulk
        mkdir -p "${func}"
        ln -sf "${func}" "${cfg}"
        mount -o mode=0777 -o uid=2000 -o gid=2000 -t functionfs bulk /dev/usb-ffs/bulk
        /home/nvidia/Desktop/startup_bulk/startup_bulk /dev/usb-ffs/bulk &
        sleep 3
    fi

    使用 ls /sys/kernel/config/usb_gadget/l4t/functions/ :

    nvidia@ubuntu:~$ ls /sys/kernel/config/usb_gadget/l4t/functions/
    ffs.bulk  rndis.usb0

    请问你们此外 nv-l4t-usb-device-mode.service, 也有 nv-l4t-usb-device-mode-runtime.service 吗

    nvidia@ubuntu:/opt/nvidia/l4t-usb-device-mode$ ls
    filesystem.img                           nv-l4t-usb-device-mode-runtime-stop.sh
    LICENSE.filesystem.img                   nv-l4t-usb-device-mode.service
    mac-addresses                            nv-l4t-usb-device-mode-start.sh
    nv-l4t-usb-device-mode-config.sh         nv-l4t-usb-device-mode-state-change.sh
    nv-l4t-usb-device-mode-runtime.service   nv-l4t-usb-device-mode-stop.sh
    nv-l4t-usb-device-mode-runtime-start.sh

    因为我们的NX真在使用 Jetpack 5.x 版本,你们能升级 Jetpack 版本然后再测试吗。可能有差别 。thx

    0
    Comment actions Permalink
  • DJI Developer Support
    我这边也是用的Jetpack 5.x,nv-l4t-usb-device-mode.service, nv-l4t-usb-device-mode-runtime.service不需要修改。附上NX平台bulk自环测试程序,用USB连接线将USB host和device接口自环连接,运行程序,正常会两个端口互发数据,可用来检查NX平台的bulk链路。
    0
    Comment actions Permalink
  • Tan Cher Yang

    当我j进行自环程序, 得到"libusb claim interface error, ret[-5]", 插入 otg port 时, dmesg 得到

    [13312.223375] usb 1-2: new high-speed USB device number 23 using tegra-xusb
    [13312.372885] usb 1-2: New USB device found, idVendor=0955, idProduct=7020, bcdDevice= 0.02
    [13312.372982] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [13312.372990] usb 1-2: Product: Linux for Tegra
    [13312.372995] usb 1-2: Manufacturer: NVIDIA
    [13312.373001] usb 1-2: SerialNumber: 1420222055450
    [13312.375851] tegra-xudc 3550000.xudc: EP 5 (type: intr, dir: in) enabled
    [13312.375875] tegra-xudc 3550000.xudc: EP 3 (type: bulk, dir: in) enabled
    [13312.375890] tegra-xudc 3550000.xudc: EP 2 (type: bulk, dir: out) enabled
    [13312.380453] rndis_host 1-2:1.0 usb0: register 'rndis_host' at usb-3610000.xhci-2, RNDIS device, da:0c:7e:dc:ca:84
    [13316.156037] l4tbr0: port 1(rndis0) entered blocking state
    [13316.156055] l4tbr0: port 1(rndis0) entered forwarding state
    [13316.158085] IPv6: ADDRCONF(NETDEV_CHANGE): l4tbr0: link becomes ready

    EP 号码错了吗, 如何修改。thx

     

    0
    Comment actions Permalink
  • DJI Developer Support
    需要将host与device自环连接,"libusb claim interface error, ret[-5]看起来是没有连接Host。 ![](https://djisdksupport.zendesk.com/attachments/token/KFN1rBrIFS9cIRu8kTcKglRCU/?name=image.png)
    0
    Comment actions Permalink
  • Tan Cher Yang

    把host与device自环连接后, bulk链路看起来正常, 但还是不能的到stream

    nvidia@ubuntu:~/Downloads$ sudo ./bulk_debvice 
    USB device recive data        [USB bulk host data ...],     len[22]
    USB host recive data        [USB bulk device data ...],     read_len[24]
    USB device recive data        [USB bulk host data ...],     len[22]
    USB host recive data        [USB bulk device data ...],     read_len[24]
    USB device recive data        [USB bulk host data ...],     len[22]
    USB host recive data        [USB bulk device data ...],     read_len[24]
    USB device recive data        [USB bulk host data ...],     len[22]
    USB host recive data        [USB bulk device data ...],     read_len[24]

    怀疑电路有问题。 能提供你们测试时 xavier 和 m30 之间的链接的照片。依照 psdk github 的 pdf  可能出错了。 thx

    0
    Comment actions Permalink
  • #YUAN SHENGHAI#

    请问有跟新的解决方案么?

    0
    Comment actions Permalink
  • DJI Developer Support
    附件提供了一个NX平台可以运行的sample执行文件,可以放入平台上运行一下。 串口设备名:ttyUSB0 网口:l4tbr0 运行后提供一下运行log,ls命令显示截图,以及ifconfig截图。
    0
    Comment actions Permalink

Please sign in to leave a comment.