PSDK 2.0 DJi Pilot 的自定义控件 偶尔会加载失败

Completed

Comments

16 comments

  • DJI Developer Support
    linux系统中,PSDK自定义控件初始与网络有关,如果网络不通会出现自定义控件出不来的现象。 建议检查网络是否稳定,及看下PSDK log是否有打印网络不通的现象。
    0
    Comment actions Permalink
  • Hao Tang

    没有打印网络不通的log,网络直接接入云台,应该是稳定的。有接口可以查询自定义控件的传输是否成功吗?获取浮动窗口通道状态的函数是否可用来查询自定义控件的状态?

    0
    Comment actions Permalink
  • DJI Developer Support
    尊敬的客户, 您好!感谢您联系DJI大疆创新。 如果初始化不成功,在PsdkTest_WidgetInit中的以下函数会报错。 ![](https://djisdksupport.zendesk.com/attachments/token/bPoWCVy1kRyzGmXoTMt0ctzkO/?name=inline-1652479520.png) 根据您的描述,​如果网口稳定,log也没报错,有可能是功能初始成功,只Pilot显示问题,您用的Pilot的版本是多少,如果用的是v3版本,建议您尝试清除Pilot的缓存试试(设置->应用->DJI Pilot->存储->清除缓存)。 如果还是不行,麻烦提供以下信息,我们看是否能复现: 1、飞机和遥控器固件版本,Pilot版本。 2、提供PSDK log。 3、提供拍摄的视频看看,包括ping指令看网络状态,以及您的操作过程和现象。 感谢您的理解与支持,祝您生活愉快! Best Regards, DJI大疆创新SDK技术支持
    0
    Comment actions Permalink
  • Hao Tang

    已尝试清除Pilot的缓存,依然会有失败的现象;

    飞机和遥控器固件版本:01.00.0710;

    Pilot版本:V2.3.1.5;

    PSDK Log:

    1970:01:01 00:11:01 : PsdkUser_Console_1656:[661.648][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0x63FC cur:0x0000[0m
     
    1970:01:01 00:11:01 : PsdkUser_Console_1656:[661.748][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0x8FE3 cur:0x0041[0m
     
    1970:01:01 00:11:01 : PsdkUser_Console_1656:[661.848][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0x7A71 cur:0x0000[0m
     
    1970:01:01 00:11:01 : PsdkUser_Console_1656:[662.048][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0x6D12 cur:0x0444[0m
     
    1970:01:01 00:11:02 : PsdkUser_Console_1656:[662.248][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0x41E7 cur:0x0041[0m
     
    1970:01:01 00:11:02 : PsdkUser_Console_1656:[662.348][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0x668D cur:0x0041[0m
     
    1970:01:01 00:11:02 : PsdkUser_Console_1656:[662.448][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0x5765 cur:0x0000[0m
     
    1970:01:01 00:11:02 : PsdkUser_Console_1656:[662.548][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0xC2B5 cur:0xD5C8[0m
     
    1970:01:01 00:11:02 : PsdkUser_Console_1656:[662.648][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0xDA8B cur:0x4203[0m
     
    1970:01:01 00:11:02 : PsdkUser_Console_1656:[662.748][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0x2E6C cur:0x0041[0m
     
    1970:01:01 00:11:02 : PsdkUser_Console_1656:[662.848][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0x4232 cur:0x0041[0m
     
    1970:01:01 00:11:02 : PsdkUser_Console_1656:[662.888][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0xE77D cur:0x4100[0m
     
    1970:01:01 00:11:02 : PsdkUser_Console_1656:[662.948][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0x2C9A cur:0x0041[0m
     
    1970:01:01 00:11:02 : PsdkUser_Console_1656:[663.048][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0x7CE2 cur:0x042C[0m
     
    1970:01:01 00:11:03 : PsdkUser_Console_1656:[663.148][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0x125D cur:0x0041[0m
     
    1970:01:01 00:11:03 : PsdkUser_Console_1656:[663.188][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0x30E8 cur:0x0F00[0m
     
    1970:01:01 00:11:03 : PsdkUser_Console_1656:[663.248][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0xDF9C cur:0x0041[0m
     
    1970:01:01 00:11:03 : PsdkUser_Console_1656:[663.288][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0xD699 cur:0x1F0C[0m
     

    1970:01:01 00:11:04 : PsdkUser_Console_1656:[664.668][module_command]-[31m[Error]-[PsdkCommand_SendASyncHandle:866]Command async send error 0[0m
     
    1970:01:01 00:11:04 : PsdkUser_Console_1656:[664.668][module_xport]-[33m[Warn]-[PsdkXPort_GetUserParameterAsyncCallback:998]get user parameter timeout.[0m
     
    1970:01:01 00:11:04 : PsdkUser_Console_1656:[664.668][module_command]-[31m[Error]-[PsdkCommand_SendASyncHandle:866]Command async send error 1[0m
     
    1970:01:01 00:11:04 : PsdkUser_Console_1656:[664.668][module_xport]-[33m[Warn]-[PsdkXPort_GetUserParameterAsyncCallback:998]get user parameter timeout.[0m
     
    1970:01:01 00:11:04 : PsdkUser_Console_1656:[664.668][module_command]-[31m[Error]-[PsdkCommand_SendASyncHandle:866]Command async send error 2[0m
     
    1970:01:01 00:11:04 : PsdkUser_Console_1656:[664.668][module_xport]-[33m[Warn]-[PsdkXPort_GetUserParameterAsyncCallback:998]get user parameter timeout.[0m
     
    1970:01:01 00:11:04 : PsdkUser_Console_1656:[664.668][module_command]-[31m[Error]-[PsdkCommand_SendASyncHandle:866]Command async send error 3[0m
     
    1970:01:01 00:11:04 : PsdkUser_Console_1656:[664.668][module_xport]-[33m[Warn]-[PsdkXPort_GetUserParameterAsyncCallback:998]get user parameter timeout.[0m
     
    1970:01:01 00:11:04 : PsdkUser_Console_1656:[664.668][module_command]-[31m[Error]-[PsdkCommand_SendASyncHandle:866]Command async send error 4[0m
     
    1970:01:01 00:11:04 : PsdkUser_Console_1656:[664.668][module_xport]-[33m[Warn]-[PsdkXPort_GetUserParameterAsyncCallback:998]get user parameter timeout.[0m

     
    1970:01:01 00:01:02 : PsdkUser_Console_1656:[62.525][module_camera]-[31m[Error]-[PsdkCamera_SetFocusRingValueHandle:2203]set focus ring value error: 0x00000100.[0m
     
    1970:01:01 00:01:02 : PsdkUser_Console_1656:[62.642][module_camera]-[31m[Error]-[PsdkCamera_SetFocusRingValueHandle:2203]set focus ring value error: 0x00000100.[0m
     
    1970:01:01 00:01:03 : PsdkUser_Console_1656:[62.711][module_camera]-[31m[Error]-[PsdkCamera_SetFocusRingValueHandle:2203]set focus ring value error: 0x00000100.[0m
     
    1970:01:01 00:02:01 : PsdkUser_Console_1656:[121.067][module_camera]-[31m[Error]-[PsdkCamera_SetMeteringModeHandle:1979]set metering mode error: 0x00000100.[0m
     

    操作过程:遥控器一直保持开机状态,只对无人机做开关机操作(二十次);

    现象:在遥控器端,自定义控件有两三次加载不出来(有时重新关闭遥控器显示屏,自定义控件又能重新加载出来)。

     

     

    0
    Comment actions Permalink
  • Hao Tang

    因为网口直接接入云台,检查网络状态,ping 的参数是什么?

    0
    Comment actions Permalink
  • Hao Tang

    以下是我PSDK的启动代码,初始化流程是否有问题,Widget_Init和Psdk_XPortInit函数的位置我修改过多次,都无效:

        T_PsdkReturnCode returnCode;

        T_PsdkUserInfo userInfo;

        T_PsdkLoggerConsole printConsole = {
            .consoleLevel = PSDK_LOGGER_CONSOLE_LOG_LEVEL_ERROR,
            .func = PsdkUser_Console,
        };
            
        T_PsdkHalUartHandler halUartHandler = {
            .UartInit = Hal_UartInit,
            .UartReadData = Hal_UartReadData,
            .UartWriteData = Hal_UartSendData,
        };

        T_PsdkHalNetWorkHandler halNetWorkHandler = {
            .NetWorkConfig = HalNetWork_Config,
        };

        T_PsdkOsalHandler osalHandler = {
            .Malloc = Osal_Malloc,
            .Free = Osal_Free,
            .TaskCreate = Osal_TaskCreate,
            .TaskDestroy = Osal_TaskDestroy,
            .TaskSleepMs = Osal_TaskSleepMs,
            .MutexCreate = Osal_MutexCreate,
            .MutexDestroy = Osal_MutexDestroy,
            .MutexLock = Osal_MutexLock,
            .MutexUnlock = Osal_MutexUnlock,
            .SemaphoreCreate = Osal_SemaphoreCreate,
            .SemaphoreDestroy = Osal_SemaphoreDestroy,
            .SemaphoreWait = Osal_SemaphoreWait,
            .SemaphorePost = Osal_SemaphorePost,
            .SemaphoreTimedWait = Osal_SemaphoreTimedWait,
            .GetTimeMs = Osal_GetTimeMs,
        };

        T_PsdkAircraftInfoBaseInfo aircraftBaseInfo = {0};

        if (PsdkPlatform_RegHalUartHandler(&halUartHandler) != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
            printf("psdk register hal uart handler error");
            WRITE_SD_LOG("psdk register hal uart handler error.");
            return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
        }

        if (PsdkPlatform_RegHalNetworkHandler(&halNetWorkHandler) != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
            printf("psdk register hal network handler error");
            WRITE_SD_LOG("psdk register hal network handler error.");
            return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
        }

        if (PsdkPlatform_RegOsalHandler(&osalHandler) != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
            printf("psdk register osal handler error");
            WRITE_SD_LOG("psdk register osal handler error.");
            return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
        }

        if (PsdkUser_FillInUserInfo(&userInfo) != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
            printf("psdk fill in user info error");
            WRITE_SD_LOG("psdk fill in user info error.");
            return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
        }

        pthread_t CheckCoreInitTid = 0;
        pthread_create(&CheckCoreInitTid, NULL, CheckCoreInitResultTask, NULL);
        
        printf("Psdk Core Start Init...\n");
        //int64_t InitStartTimeMs = time_ms();
        returnCode = PsdkCore_Init(&userInfo);
        if (returnCode != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
            g_bPsdkCoreInitFinish = true;
            LOGE("psdk core init error returnCode== %lld", returnCode);
            printf("psdk core init error returnCode== %lld \n", returnCode);
            WRITE_SD_LOG("psdk core init error.");
            return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
        }
        g_bPsdkCoreInitFinish = true;
        //printf("Psdk Core Init time == %d ms! \n", time_ms() - InitStartTimeMs);
        printf("Psdk Core Init Finish!\n");

        if (Widget_Init(SystemType) != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
            LOGE("Widget_Init error.");
            WRITE_SD_LOG("Widget_Init error.");
            return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
        }
            
        if (PsdkAircraftInfo_GetBaseInfo(&aircraftBaseInfo) != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
            PsdkLogger_UserLogError("get aircraft information error.");
            WRITE_SD_LOG("get aircraft information error.");
            return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
        }

        if (PsdkLogger_AddConsole(&printConsole) != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
            printf("psdk add console print error\n");
            WRITE_SD_LOG("psdk add console print error.");
            return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
        }
         
        /** 初始化功能模块 */
        
        //设置带宽占用比例
        T_PsdkDataChannelBandwidthProportionOfHighspeedChannel bandwidthProportion;    
        bandwidthProportion.videoStream = 30;
        bandwidthProportion.dataStream = 50;
        bandwidthProportion.downloadStream = 20;    
        returnCode = PsdkDataChannel_SetBandwidthProportionForHighspeedChannel(bandwidthProportion);
        if(returnCode != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS){
            LOGE("Set Bandwidth Proportion error:%lld", returnCode);
            WRITE_SD_LOG("Set Bandwidth Proportion error.");
            return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
        }

        if((PSDK_AIRCRAFT_INFO_TYPE_M210RTK_V2 == aircraftBaseInfo.aircraftType) ||
            (PSDK_AIRCRAFT_INFO_TYPE_M300_RTK == aircraftBaseInfo.aircraftType)){
            g_bUavRTKFlag = true;
        }else{
            g_bUavRTKFlag = false;
        }

        //相机初始化
        if (Camera_Init() != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
            LOGE("Camera_Init error.");
            WRITE_SD_LOG("Camera_Init error.");
            return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
        }
        
        if(PowerManagementInit() != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
            LOGE("PowerManagementInit error.");
            WRITE_SD_LOG("PowerManagementInit error.");
            return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
        }

        if(aircraftBaseInfo.psdkAdapterType == PSDK_AIRCRAFT_INFO_PSDK_ADAPTER_TYPE_XPORT){
            if (Psdk_XPortInit() != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
                LOGE("Psdk_XPortInit error.");
                WRITE_SD_LOG("Psdk_XPortInit error.");
                return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
            }
        }
        
        /** DataSubscription_Init 一定要在 Psdk_XPortInit 之后 */
        if (DataSubscription_Init() != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
            LOGE("DataSubscription error.");
            WRITE_SD_LOG("DataSubscription error.");
            return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
        }

        //设置负载设备的别称
        if (PsdkProductInfo_SetAlias(DEVICE_NAME) != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
            //LOGE("set product alias error.");
            WRITE_SD_LOG("set product alias error.");
            return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
        }
        
        if (PsdkCore_ApplicationStart() != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
            LOGE("psdk application start error");
            WRITE_SD_LOG("psdk application start error.");
            return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
        }

    0
    Comment actions Permalink
  • DJI Developer Support
    您提到您有更改示例,1)建议您用示例程序进行测试,2)另外可以升级飞机和遥控器至V3固件版本,3)用ping指令看与飞机通信状态,如果是1号云台口是192.168.110.1,如果是2号云台口是192.168.111.1( 显示不出自定义控件时,ping下看看网络情况 )
    0
    Comment actions Permalink
  • Hao Tang

    无论自定义控件是否加载成功,192.168.110.1和192.168.111.1这两个ip都ping不通。我使用的PSDK版本是Payload_SDK_V2.2.1。

    0
    Comment actions Permalink
  • Hao Tang

    飞机和遥控器是V3固件版本,但是依然无效。

    0
    Comment actions Permalink
  • DJI Developer Support
    抱歉,这边以为您用的是M300机型,前面提到的ip是M300下方2个云台口的。如果您用的是M200 v2系统,挂1号云台口是192.168.5.10,您可以参考以下图片。 ![](https://djisdksupport.zendesk.com/attachments/token/v9eYxiXNR5hOQ8MrYFeY4m2cS/?name=image.png) ![](https://djisdksupport.zendesk.com/attachments/token/UTrVFNIFNGoOzDRR1ycOvvo02/?name=image.png)
    0
    Comment actions Permalink
  • Hao Tang

    每次启动,实时图像传输显示都是正常的,只是自定义控件刷新不出来时,192.168.5.10一直能ping通。尝试清除Pilot的缓存能把自定义控件刷新出来(不是每次都有效,实际上清除Pilot缓存和关显示屏一样,都是重启了DJ Pilot软件)。

    0
    Comment actions Permalink
  • DJI Developer Support
    麻烦提供下您的操作过程视频和现象,这边看看是否能复现(可以用百度网盘上传视频),另外您现在的Pilot版本也可以拍下来。
    0
    Comment actions Permalink
  • Hao Tang

    视频中第一次开机就出现自定义控件加载失败(清理缓存后再次进入就加载成功了)的问题,第二次开机则是正常的。

    操作过程视频百度云盘链接:https://pan.baidu.com/s/1ur_wpAMiIZiqzdzZ5xOTgQ
    提取码:styi

     

    Pilot版本截图如下:

    0
    Comment actions Permalink
  • DJI Developer Support
    好的 ,收到您的视频,这边提交工程师进一步确认。 另外,这边测试,只要杀掉app,重启app就可以,不用清缓存,您可以试试。
    0
    Comment actions Permalink
  • DJI Developer Support
    如果有进展,会及时告知您。
    0
    Comment actions Permalink
  • DJI Developer Support
    抱歉,这边跟工程师确认,这个是Pilot端的问题,及由于此Pilot版本太老,已经不再维护。 如果出现此问题,建议您杀掉app,重启app。
    0
    Comment actions Permalink

Please sign in to leave a comment.