Any working code samples for PSDK using E-port on M350?
CompletedI am new to the PSDK. I have the E-port development kit attached to the M350's E-port such that the cable's B side is up on the dev kit and the B side is facing outwards on the drone side, and its green light turns on. The E-port is recognized as /dev/ttyACM0 on my computer (generic Linux computer, not manifold2). I compiled the sample code at https://github.com/dji-sdk/Payload-SDK successfully after inputting my credentials and changing LINUX_UART_DEV1 to "/dev/ttyACM0" in hal_uart.h.
When I run the executable ./build/bin/dji_sdk_demo_linux or ./build/bin/dji_sdk_demo_linux, all I get is the following error over and over again:
[16.341][adapter]-[Info]-[DjiAccessAdapter_Init:170) Try identify UART0 connection failed. Probably because SDK adapter or aircraft not finish init or UART connect error.
I have tried different baud rates, tried setting the dev kit as host (but then my computer does not recognize it), and it never shows up in DJI Assistant 2 as a Payload SDK device.
I assume I need to be connecting to it in the software as a network device, not a UART, but I am completely new to the PSDK and I'm not sure how to do this.
Does anyone have any input, or a working code sample for the E-port development kit?
-
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. -
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?
-
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 -
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.
Please sign in to leave a comment.
Comments
8 comments