PSDK3.3.0初始化不成功,串口报错
已完成前提,同样硬件飞机,只是换了程序。M300飞机,xport开发
PSDK2.2.1版本在M300上能正常初始化:
[1992033.655][module_core]-[Info]-[PsdkCore_Init:76]Payload SDK Version : V2.2.1-beta.0-build.315
[1992033.674][module_core]-[Info]-[PsdkCore_WaitAdapterConnection:234]Connect to Skyport V2 or X-Port success
[1992033.695][module_core]-[Info]-[PsdkCore_PrintAdapterSerialNumber:278]Get serial number of Skyport V2 or X-Port is 34DDJC7001X548
[1992033.695][module_core]-[Info]-[PsdkCore_Init:130]Updating PSDK policy file.
[1992033.734][module_aircraftinfo]-[Info]-[PsdkAircraftInfo_GetAircraftTypeAsyncCallback:402]aircraft type is Matrice 300 RTK.
[1992033.734][module_aircraftinfo]-[Info]-[PsdkAircraftInfo_GetDevelopmentKitTypeAsyncCallback:483]PSDK adapter type is X-Port.
[1992034.704][module_core]-[Info]-[PsdkCore_Init:133]PSDK policy file update success.
[1992035.214][module_core]-[Info]-[PsdkCore_Init:146]PSDK is connecting aircraft.
[1992035.724][module_core]-[Info]-[PsdkCore_Init:146]PSDK is connecting aircraft.
[1992036.234][module_core]-[Info]-[PsdkCore_Init:146]PSDK is connecting aircraft.
[1992036.744][module_core]-[Info]-[PsdkCore_Init:146]PSDK is connecting aircraft.
[1992037.254][module_core]-[Info]-[PsdkCore_Init:146]PSDK is connecting aircraft.
[1992037.734][module_aircraftinfo]-[Info]-[PsdkAircraftInfo_GetPayloadMountPositionAsyncCallback:582]This payload is mounted on NO.1 gimbal connector.
[1992037.764][module_core]-[Info]-[PsdkCore_Init:146]PSDK is connecting aircraft.
[1992037.764][module_core]-[Info]-[PsdkCore_Init:156]Aircraft is Matrice 300 RTK, PSDK adapter is X-Port, this payload is mounted on NO.1 gimbal connector.
[1992037.764][module_nego]-[Info]-[PsdkPayloadNegotiate_Init:138]Waiting payload negotiate finish.
[1992038.774][module_nego]-[Info]-[PsdkPayloadNegotiate_Init:138]Waiting payload negotiate finish.
[1992039.784][module_nego]-[Info]-[PsdkPayloadNegotiate_Init:138]Waiting payload negotiate finish.
[1992039.874][module_command]-[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0x748F cur:0x1000
[1992040.795][module_nego]-[Info]-[PsdkPayloadNegotiate_Init:138]Waiting payload negotiate finish.
[1992041.074][module_command]-[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0xB6BD cur:0x1000
[1992041.804][module_nego]-[Info]-[PsdkPayloadNegotiate_Init:138]Waiting payload negotiate finish.
[1992042.814][module_nego]-[Info]-[PsdkPayloadNegotiate_Init:138]Waiting payload negotiate finish.
[1992043.824][module_nego]-[Info]-[PsdkPayloadNegotiate_Init:138]Waiting payload negotiate finish.
[1992044.834][module_nego]-[Info]-[PsdkPayloadNegotiate_Init:138]Waiting payload negotiate finish.
[1992045.844][module_nego]-[Info]-[PsdkPayloadNegotiate_Init:138]Waiting payload negotiate finish.
[1992046.854][module_nego]-[Info]-[PsdkPayloadNegotiate_Init:138]Waiting payload negotiate finish.
[1992047.864][module_nego]-[Info]-[PsdkPayloadNegotiate_Init:138]Waiting payload negotiate finish.
[1992048.874][module_nego]-[Info]-[PsdkPayloadNegotiate_Init:138]Waiting payload negotiate finish.
[1992049.914][module_nego]-[Info]-[PsdkPayloadNegotiate_RemoveDeviceSync:252]waiting payload negotiate finish.
[1992050.924][module_nego]-[Info]-[PsdkPayloadNegotiate_RemoveDeviceSync:252]waiting payload negotiate finish.
[1992051.054][module_nego]-[Info]-[PsdkPayloadNegotiate_VersionHandle:293]Payload negotiate use dynamic ip config
[1992051.394][module_nego]-[Info]-[PsdkPayloadNegotiate_NotifyHandle:564]uav ip addr:192.168.110.1
[1992051.934][module_nego]-[Info]-[PsdkPayloadNegotiate_Init:155]Payload negotiate has finished.
[9921.900][module_nego]-[Info]-[PsdkPayloadNegotiate_RemoveDeviceSync:252]waiting payload negotiate finish.
[9922.910][module_nego]-[Info]-[PsdkPayloadNegotiate_RemoveDeviceSync:252]waiting payload negotiate finish.
[9923.040][module_nego]-[Info]-[PsdkPayloadNegotiate_VersionHandle:293]Payload negotiate use dynamic ip config
[9923.360][module_nego]-[Info]-[PsdkPayloadNegotiate_NotifyHandle:564]uav ip addr:192.168.110.1
[9923.920][module_user]-[Info]- get video stream remote address:192.168.110.1_23003
[9928.000][module_user]-[Info]- get data stream remote address: 192.168.110.1_23002
[9928.060][module_subscription]-[Info]-[PsdkDataSubscription_ResetPublisherDb2AsyncCallback:1616]reset publisher success.
[9928.520][module_subscription]-[Info]-[PsdkDataSubscription_RegTopicSync:603]Subscribe topic success.
[9928.560][module_subscription]-[Info]-[PsdkDataSubscription_RegTopicSync:603]Subscribe topic success.
[9929.140][module_subscription]-[Info]-[PsdkDataSubscription_RegTopicSync:603]Subscribe topic success.
[9929.720][module_subscription]-[Info]-[PsdkDataSubscription_RegTopicSync:603]Subscribe topic success.
[9930.300][module_subscription]-[Info]-[PsdkDataSubscription_RegTopicSync:603]Subscribe topic success.
[9931.440][module_subscription]-[Info]-[PsdkDataSubscription_RegTopicSync:603]Subscribe topic success.
[9931.641][module_core]-[Info]-[PsdkCore_ApplicationStart:199]Start application now.
换成PSDK3.3.0程序则报错:
baudRate:115200
[0.033][core]-[Info]-[DjiCore_Init:95) Payload SDK Version : V3.3.0-beta.0-build.1665
baudRate:460800
baudRate:115200
baudRate:230400
baudRate:460800
[0.600][adapter]-[Info]-[DjiAccessAdapter_Init:171) Identify aircraft series is Matrice 300 Series
baudRate:460800
[0.600][adapter]-[Info]-[DjiAccessAdapter_Init:189) Identify mount position type is Payload Port Type
[0.614][adapter]-[Info]-[DjiPayloadNegotiate_Start:200) Waiting payload negotiate finished.
[1.620][adapter]-[Info]-[DjiPayloadNegotiate_Start:200) Waiting payload negotiate finished.
[2.630][adapter]-[Info]-[DjiPayloadNegotiate_Start:200) Waiting payload negotiate finished.
baudRate:460800
[3.689][adapter]-[Info]-[DjiPayloadNegotiate_Start:200) Waiting payload negotiate finished.
[4.690][adapter]-[Info]-[DjiPayloadNegotiate_Start:200) Waiting payload negotiate finished.
[5.700][adapter]-[Info]-[DjiPayloadNegotiate_Start:200) Waiting payload negotiate finished.
[6.710][adapter]-[Info]-[DjiPayloadNegotiate_Start:200) Waiting payload negotiate finished.
[7.720][adapter]-[Info]-[DjiPayloadNegotiate_Start:200) Waiting payload negotiate finished.
[9.827][core]-[Info]-[DjiIdentityVerify_UpdatePolicy:411) Updating dji sdk policy file...
[10.830][core]-[Info]-[DjiIdentityVerify_UpdatePolicy:414) Update dji sdk policy file successfully
[13.330][linker]-[Warn]-[DjiCommand_SendAsyncHandle:860) Command async send retry: index = 0, retryTimes = 3, cmdSet = 0, cmdId = 81
[13.540][linker]-[Warn]-[DjiCommand_SendAsyncHandle:860) Command async send retry: index = 0, retryTimes = 2, cmdSet = 0, cmdId = 81
[13.750][linker]-[Warn]-[DjiCommand_SendAsyncHandle:860) Command async send retry: index = 0, retryTimes = 1, cmdSet = 0, cmdId = 81
[13.770][infor]-[Info]-[DjiAircraftInfo_GetAdapterSerialNumber:646) Get serial number of Skyport V2 or X-Port is 34DDJC7001X548
[13.783][core]-[Info]-[DjiCore_Init:163) Identify AircraftType = Matrice 300 RTK, MountPosition = Payload Port NO1, SdkAdapterType = X-Port
[13.990][linker]-[Warn]-[DjiCommand_SendAsyncHandle:860) Command async send retry: index = 1, retryTimes = 3, cmdSet = 5, cmdId = 11
[14.200][linker]-[Warn]-[DjiCommand_SendAsyncHandle:860) Command async send retry: index = 1, retryTimes = 2, cmdSet = 5, cmdId = 11
[14.410][linker]-[Warn]-[DjiCommand_SendAsyncHandle:860) Command async send retry: index = 1, retryTimes = 1, cmdSet = 5, cmdId = 11
[14.620][linker]-[Error]-[DjiCommand_SendAsyncHandle:872) Command async send error 1
[14.620][linker]-[Error]-[DjiCommand_SendSync:475) sendSync callback timeout
[14.620][collaboration]-[Error]-[DjiPayloadCollaboration_SubscribeOtherCameraSystemStateOnM300:651) subscribe other camera system state error: 0x000000E1.
[14.620][collaboration]-[Error]-[DjiPayloadCollaboration_Init:159) subscribe other camera system state error: 0x000000E1.
[14.620][core]-[Error]-[DjiCore_Init:194) Execution timeout. Suggestion : Please contact DJI for help.
[14.620][core]-[Error]-[DjiCore_Init:195) Payload collaboration init error
[14.620][user]-[Error]-[dji_init:117) Core init error
[14.790][linker]-[Error]-[DjiCommand_SendAsyncHandle:872) Command async send error 0
[14.790][infor]-[Warn]-[DjiAircraftInfo_CheckPingStatusAsyncCallback:229) connect status async timeout
[34.790][linker]-[Error]-[DjiCommand_SendAsyncHandle:872) Command async send error 0
[34.790][infor]-[Warn]-[DjiAircraftInfo_CheckPingStatusAsyncCallback:229) connect status async timeout
换过波特率,115200,230400,460800,921600都会报错。都是代码里面和dji assistant 2 同步修改,打印出HalUart_Init 参数baudRate也都对得上。
DJI_HAL_UART_NUM_1设置为false,NUM_0为PSDK2.x同样的设备
-
日志看起来是获取另一个负载相机信息出错,PSDK 3.x和PSDK 2.x这部分初始化有点差异。这个问题是不是飞机上电给负载设备上电启动是出现的问题?若是,可以稍微延时启动PSDK core看是否能缓解问题。若依旧大概率出现异常,建议导出无人机的整机日志,以及无人机固件版本,并描述一下复现步骤。我们将进一步评估确认。 ![](https://djisdksupport.zendesk.com/attachments/token/ulUsIwr1zR31I50CAXdk5Ylft/?name=image.png) -
延时启动没缓解,而且关键在于,每次启动不一定都是获取另一个负载相机出错,比如:
[0.014][core]-[Info]-[DjiCore_Init:95) Payload SDK Version : V3.3.0-beta.0-build.1665
[0.580][adapter]-[Info]-[DjiAccessAdapter_Init:171) Identify aircraft series is Matrice 300 Series
[0.580][adapter]-[Info]-[DjiAccessAdapter_Init:189) Identify mount position type is Payload Port Type
[0.595][adapter]-[Info]-[DjiPayloadNegotiate_Start:200) Waiting payload negotiate finished.
[1.600][adapter]-[Info]-[DjiPayloadNegotiate_Start:200) Waiting payload negotiate finished.
[2.656][adapter]-[Info]-[DjiPayloadNegotiate_Start:200) Waiting payload negotiate finished.
[3.660][adapter]-[Info]-[DjiPayloadNegotiate_Start:200) Waiting payload negotiate finished.
[4.670][adapter]-[Info]-[DjiPayloadNegotiate_Start:200) Waiting payload negotiate finished.
[5.680][adapter]-[Info]-[DjiPayloadNegotiate_Start:200) Waiting payload negotiate finished.
[6.690][adapter]-[Info]-[DjiPayloadNegotiate_Start:200) Waiting payload negotiate finished.
[9.605][core]-[Info]-[DjiIdentityVerify_UpdatePolicy:411) Updating dji sdk policy file...
[10.610][core]-[Info]-[DjiIdentityVerify_UpdatePolicy:414) Update dji sdk policy file successfully
[12.420][linker]-[Warn]-[DjiCommand_SendAsyncHandle:860) Command async send retry: index = 0, retryTimes = 3, cmdSet = 0, cmdId = 81
[12.630][linker]-[Warn]-[DjiCommand_SendAsyncHandle:860) Command async send retry: index = 0, retryTimes = 2, cmdSet = 0, cmdId = 81
[12.840][linker]-[Warn]-[DjiCommand_SendAsyncHandle:860) Command async send retry: index = 0, retryTimes = 1, cmdSet = 0, cmdId = 81
[13.050][linker]-[Error]-[DjiCommand_SendAsyncHandle:872) Command async send error 0
[13.050][linker]-[Error]-[DjiCommand_SendSync:475) sendSync callback timeout
[13.051][infor]-[Error]-[DjiAircraftInfo_GetAdapterSerialNumber:659) Can't get the serial num of Skyport V2 or X-Port. Probably because DJI Adapter not finish init or hardware error. Please contact DJI for help.
[13.770][linker]-[Warn]-[DjiCommand_SendAsyncHandle:860) Command async send retry: index = 0, retryTimes = 3, cmdSet = 0, cmdId = 81
[13.900][infor]-[Info]-[DjiAircraftInfo_GetAdapterSerialNumber:646) Get serial number of Skyport V2 or X-Port is 34DDJB9001BG1S
[13.912][core]-[Info]-[DjiCore_Init:163) Identify AircraftType = Matrice 300 RTK, MountPosition = Payload Port NO1, SdkAdapterType = X-Port
[14.120][linker]-[Warn]-[DjiCommand_SendAsyncHandle:860) Command async send retry: index = 1, retryTimes = 3, cmdSet = 5, cmdId = 11
[14.330][linker]-[Warn]-[DjiCommand_SendAsyncHandle:860) Command async send retry: index = 1, retryTimes = 2, cmdSet = 5, cmdId = 11
[14.540][linker]-[Warn]-[DjiCommand_SendAsyncHandle:860) Command async send retry: index = 1, retryTimes = 1, cmdSet = 5, cmdId = 11
[14.750][linker]-[Error]-[DjiCommand_SendSync:475) sendSync callback timeout
[14.750][collaboration]-[Error]-[DjiPayloadCollaboration_SubscribeOtherCameraSystemStateOnM300:651) subscribe other camera system state error: 0x000000E1.
[14.750][collaboration]-[Error]-[DjiPayloadCollaboration_Init:159) subscribe other camera system state error: 0x000000E1.
[14.750][core]-[Error]-[DjiCore_Init:194) Execution timeout. Suggestion : Please contact DJI for help.
[14.750][core]-[Error]-[DjiCore_Init:195) Payload collaboration init error
[14.750][user]-[Error]-[dji_init:117) Core init error
[14.920][linker]-[Error]-[DjiCommand_SendAsyncHandle:872) Command async send error 0
[14.920][infor]-[Warn]-[DjiAircraftInfo_CheckPingStatusAsyncCallback:229) connect status async timeout
[34.920][linker]-[Error]-[DjiCommand_SendAsyncHandle:872) Command async send error 0
[34.920][infor]-[Warn]-[DjiAircraftInfo_CheckPingStatusAsyncCallback:229) connect status async timeout还有可能是获取挂载信息出错,甚至获取Xport信息出错。
并且还有一个现象就是dji assistant2 上来看,Payload SDK 负载连接状态,是一直在未连接和已连接之间反复变化。初步估计此原因导致初始化时获取信息超时,并且后续使用也用不了。
两秒后又
一直循环。
换过xport,换过板子(PSDK2.x版本都没问题)。在重启飞机,或不重启飞机直接重启程序的情况下都会出现。
无人机日志已导出,无人机版本
-
看起来还是初始化启动的问题,麻烦将飞机日志和完整的PSDK运行日志通过邮箱发送至dev@dji.com吧,如果日志太大,会另通过邮箱另建网盘上传日志。
请先登录再写评论。
评论
5 条评论