dji-sdk / Payload-SDK

DJI Payload SDK Official Repository
https://github.com/dji-sdk/Payload-SDK
Other
266 stars 118 forks source link

Protocol error #208

Closed GregCornis closed 1 month ago

GregCornis commented 1 month ago

I have a raspberry pi 5 connecter to a Skyport V2 (via developper board) to a M300. I'm running the PSDK sample code, which compiles fine, but the program fails to run the negociation and fails. Do you have any idea what the problem might be ? Is it an issue with a configuration ?

Here are the logs

'Logs/latest.log' -> 'DJI_0018_20240927_17-18-51.log'
[0.004][core]-[Info]-[DjiCore_Init:106) Payload SDK Version : V3.9.1-beta.0-build.2090
[0.341][adapter]-[Info]-[DjiAccessAdapter_Init:231) Identify aircraft series is Matrice 300 Series
[0.341][adapter]-[Info]-[DjiAccessAdapter_Init:264) Identify mount position type is Payload Port Type
[0.342][adapter]-[Info]-[DjiAccessAdapter_Init:365) Identity uart0 baudrate is 460800 bps
[0.347][adapter]-[Info]-[DjiPayloadNegotiate_Init:243) Waiting payload negotiate finished.
...
[10.050][linker]-[Warn]-[DjiProtocol_v1Unpack:187) protocol frame crc16 error, exp:0x1E3D cur:0x0D73
[10.348][adapter]-[Info]-[DjiPayloadNegotiate_Init:243) Waiting payload negotiate finished.
[10.545][linker]-[Warn]-[DjiProtocol_v1Unpack:187) protocol frame crc16 error, exp:0x5D12 cur:0x0D83
...
[51.050][linker]-[Warn]-[DjiProtocol_v1Unpack:187) protocol frame crc16 error, exp:0x6369 cur:0x1329
[51.352][linker]-[Error]-[DjiCommand_SendAsyncHandle:975) Command async send error 0
[51.352][linker]-[Error]-[DjiCommand_SendSync:550) sendSync callback timeout
[51.352][adapter]-[Error]-[DjiPayloadNegotiate_RemoveDeviceSync:1170) remove device sync se[51.352][adapter]-[Error]-[DjiPayloadNegotiate_RemoveDeviceSync:1170) remove device sync send error:0x000000E1.
[51.352][adapter]-[Error]-[DjiPayloadNegotiate_Init:255) Payload negotiate remove device sync error:0x000000FF
[51.352][adapter]-[Error]-[DjiAccessAdapter_Init:381) Payload negotiate error, returnCode = 255
[51.352][core]-[Error]-[DjiCore_Init:126) Access adapter init error, stat:255
[51.352][user]-[Error]-[main:131) Core init error
dji-dev commented 1 month ago

Agent comment from Leon in Zendesk ticket #118381:

Dear Developer,

Hello, thank you for contacting DJI.

This seems to be caused by the instability of your serial link. Are you using the onboard serial port or USB-TTL to complete the connection?

Thank you for your support of DJI products! Wish you all the best!

Best Regards, DJI SDK Technical Support

°°°

GregCornis commented 1 month ago

Hi, I've changed and am using a USB <> TTL adapter, it works fine now. I still have a few protocol frame crc16 error warnings in the logs, after the payload negotiation, but it works well after that. So I guess the problem is fixed

dji-dev commented 1 month ago

Agent comment from Leon in Zendesk ticket #118381:

Hello, this warning message is a serial port information verification error. If the verification fails, it will be issued repeatedly. Therefore, if this warning does not appear frequently, you can ignore it. If it prints frequently, you can adjust the baud rate to see if there is any improvement. You can try to increase or decrease the baud rate.

°°°

GregCornis commented 1 month ago

Ok thanks, I'll give it a shot

dji-dev commented 1 month ago

Agent comment from Leon in Zendesk ticket #118381:

You're welcome, we hope our suggestions are helpful to you.

°°°