This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/LAUNCHCC3235MOD: OTA API able to get URL of the tar file of cloud, but not going beyond that.

Part Number: LAUNCHCC3235MOD
Other Parts Discussed in Thread: CC3235SF

Tool/software: Code Composer Studio

Hi TI,

I got an issue when i tried to create new app over Dropbox, previously it was working well. and As per log , I believe that there is a small mistake somewhere.

Please help me to get rid from this issue.

here is logs:

isPendingCommit: status = 0

HandlePingComplete: OTA Command arrived


OtaInit: statistics = 0, 0, 0

OtaInit: call Ota_init

OTA_init: sizeof CdnClient=576, sizeof OtaArchive=5552

OTA_init: sizeof OtaLib_t=8332, sizeof OTA_memBlock=10536

OTA_init: OTA lib version = OTA_LIB_2.0.0.7

OtaArchive_Init: OTA archive version = OTA_ARCHIVE_2.0.0.4

OtaConfig: call OTA_set EXTLIB_OTA_SET_OPT_SERVER_INFO,ServerName=api.dropboxapi.com

OtaConfig: call OTA_set EXTLIB_OTA_SET_OPT_VENDOR_ID, VendorDir=OTA_MINI_MCU_FLASH

OTA_run: call CdnClient_ConnectServer OTA server=api.dropboxapi.com

CdnClient_ConnectServer: HttpClient_Connect api.dropboxapi.com

HttpClient_Connect: IP_ADDR=162.125.81.19

HttpClient_Connect: WARNING Socket Connect, status=-468, Ignored...

OTA_run: CdnClient_ReqOtaDir, VendorDir=OTA_MINI_MCU_FLASH

CdnDropbox_SendReqDir: uri=/2/files/list_folder

RespLen is 803, ProcessedSize is: 798

the entire JSON pRespBuf is: (null)

OtaJson_init: template={"entries":[{"path_display": string,"size": int32}]} , text={"entries": [{".tag": "file", "name": "20210113184239_CC3235SF_SFProject.tar", "path_lower": "/ota_mini_mcu_flash/20210113184239_cc3235sf_sfproject.tar", "path_display": "/OTA_MINI_MCU_FLASH/20210113184239_CC3235SF_SFProject.tar", "id": "id:_-wNSoxI0WAAAAAAAAABVw", "client_modified": "2021-01-13T13:13:49Z", "server_modified": "2021-01-13T13:13:49Z", "rev": "015b8c7e8f0c1ea00000001fc750d20", "size": 235520, "is_downloadable": true, "content_hash": "bb3d58f31df09609a9cc719c6edb7d50271f90b24f9516243210dc1a815939c5"}], "cursor": "AAEUdNTJ0Gm2_lyjrsB9MAVefLijcE0NR8y5dgLwk5URNLY-YDzV9C_mHTiAnWBLpJHT3pnoGUsyjbXGtyGbpTLZKR1sbdxyKAmFQrdSYOBCpeZZsrod4Ah4xeUkz01rjJgCH_hgRaZC4jAyuFzjw3PMEl0S8r5jIcOxopoH2Er0-cYvizKQutSOCUo1I78o", "has_more": false}

OtaDir FileName=/OTA_MINI_MCU_FLASH/20210113184239_CC3235SF_SFProject.tar, FileSize=235520

OTA_run: CdnClient_ReqOtaDir, NumDirFiles=1

OTA_run: CdnClient_GetNextDirFile

OTA_run: CdnClient_GetNextDirFile: file=/OTA_MINI_MCU_FLASH/20210113184239_CC3235SF_SFProject.tar, size=235520

OtaArchive_Init: OTA archive version = OTA_ARCHIVE_2.0.0.4

OtaArchive_CheckVersion: current version str = 20200831111705, decimal = 1599918617

OtaArchive_CheckVersion: new version str = 20210113184239, decimal = -2002910737

OtaArchive_CheckVersion: newer version update - 20210113184239

OtaRunStep: status from Ota_run: OTA_RUN_STATUS_CHECK_NEWER_VERSION, accept and continue

OtaRunStep: CurrentVersion=20200831111705, NewVersion=20210113184239, Start download ...

OTA_run: Call CdnClient_ReqFileUrl, filename = /OTA_MINI_MCU_FLASH/20210113184239_CC3235SF_SFProject.tar

CdnDropbox_SendReqFileUrl: uri=/2/files/get_temporary_link

HTTP request is:
POST /2/files/get_temporary_link HTTP/1.1
host: api.dropboxapi.com
Authorization: Bearer 2BlOkSA70-oAAAAAAAAAAVXicg9yBFYyUUvr7fyTY1AAAAAAAAAAAAAA
Content-Type: Application/Json
Content-Length: 69

{"path": "/OTA_MINI_MCU_FLASH/20210113184239_CC3235SF_SFProject.tar"}


OtaJson_init: template={"metadata":raw,"link": string} , text={"metadata": {"name": "20210113184239_CC3235SF_SFProject.tar", "path_lower": "/ota_mini_mcu_flash/20210113184239_cc3235sf_sfproject.tar", "path_display": "/OTA_MINI_MCU_FLASH/20210113184239_CC3235SF_SFProject.tar", "id": "id:_-wNSoxI0WAAAAAAAAABVw", "client_modified": "2021-01-13T13:13:49Z", "server_modified": "2021-01-13T13:13:49Z", "rev": "015b8c7e8f0c1ea00000001fc750d20", "size": 235520, "is_downloadable": true, "content_hash": "bb3d58f31df09609a9cc719c6edb7d50271f90b24f9516243210dc1a815939c5"}, "link": "content.dropboxapi.com/.../ApG65QIuTB6PVJ7bsMeqnNwu0HPClKoudKU1j6pwgLJUz0prfkSTGmCZd-_RaMpgQ7CCG7s97PNKtAWHt6_FaKF2lnSSwOSeS9V9-Afkt_3gRPW-RYOLr5uMLWjLJT0IGAJ0B5Nt2MziRzCETlnHVzPjqAE3lgkAxfu4pKKj7TnD2Fpk2tFVFGjyL_tdczShNmrRTz0ProSQVuNzKfgJFU9Dst6nz4qWnTxgYQFiPxkUdM9_w0ft6yHiaFEisgXSnHoxhYxgi4l85wdXdKPe4Nc6wA2XbZZE235dxQq6EuM65mkg-1uftOF5vjezTBMRixiCRkkyUgX3LLcErS27WHFdgt1JzpmzH1F-
OTA_run: Call CdnClient_ConnectFileServer, url = content.dropboxapi.com/.../ApG65QIuTB6PVJ7bsMeqnNwu0HPClKoudKU1j6pwgLJUz0prfkSTGmCZd-_RaMpgQ7CCG7s97PNKtAWHt6_FaKF2lnSSwOSeS9V9-Afkt_3gRPW-RYOLr5uMLWjLJT0IGAJ0B5Nt2MziRzCETlnHVzPjqAE3lgkAxfu4pKKj7TnD2Fpk2tFVFGjyL_tdczShNmrRTz0ProSQVuNzKfgJFU9Dst6nz4qWnTxgYQFiPxkUdM9_w0ft6yHiaFEisgXSnHoxhYxgi4l85wdXdKPe4Nc6wA2XbZZE235dxQq6EuM65mkg-

HttpClient_Connect: IP_ADDR=162.125.81.14

[SOCK EVENT] - Unexpected Event [20x]

.

.

.

.

.

.

HttpClient_Connect: ERROR Socket Connect, status=-688

CdnClient_ConnectFileServer: ERROR on HttpClient_Connect, Status=-20304

OTA_run: ERROR CdnClient_ConnectFileServer, Status=-20304


_OtaCheckConsecutiveErrors: ConsecutiveOtaErrors=4/5, return only WARNNING

OtaRunStep: WARNING Ota_run, Status=20006, continue fornext OTA retry

OTA_run: call CdnClient_ConnectServer OTA server=api.dropboxapi.com

CdnClient_ConnectServer: HttpClient_Connect api.dropboxapi.com

HttpClient_Connect: IP_ADDR=162.125.81.19

HttpClient_Connect: WARNING Socket Connect, status=-468, Ignored...

OTA_run: CdnClient_ReqOtaDir, VendorDir=OTA_MINI_MCU_FLASH

CdnDropbox_SendReqDir: uri=/2/files/list_folder

RespLen is 803, ProcessedSize is: 798

the entire JSON pRespBuf is: (null)

OtaJson_init: template={"entries":[{"path_display": string,"size": int32}]} , text={"entries": [{".tag": "file", "name": "20210113184239_CC3235SF_SFProject.tar", "path_lower": "/ota_mini_mcu_flash/20210113184239_cc3235sf_sfproject.tar", "path_display": "/OTA_MINI_MCU_FLASH/20210113184239_CC3235SF_SFProject.tar", "id": "id:_-wNSoxI0WAAAAAAAAABVw", "client_modified": "2021-01-13T13:13:49Z", "server_modified": "2021-01-13T13:13:49Z", "rev": "015b8c7e8f0c1ea00000001fc750d20", "size": 235520, "is_downloadable": true, "content_hash": "bb3d58f31df09609a9cc719c6edb7d50271f90b24f9516243210dc1a815939c5"}], "cursor": "AAH41iVw3RoI2-Bmh0NlbI-BBzRyCXduEMugLF9It3yJNOuoyKgfVvMVYgKR_U3VJsg5Vj376VTcc8C6TJEI5SSS8vA-dddT_pxugVEmhjOViKtLN8zBCAifd82SRClPUsDPW500g1qj2ds57q0rzpUVd57p085vjiRHE5tc4gfGW5QECH4DLTomRKo-kn5A3d59Z3jd3i", "has_more": false}

OtaDir FileName=/OTA_MINI_MCU_FLASH/20210113184239_CC3235SF_SFProject.tar, FileSize=235520

OTA_run: CdnClient_ReqOtaDir, NumDirFiles=1

OTA_run: CdnClient_GetNextDirFile

OTA_run: CdnClient_GetNextDirFile: file=/OTA_MINI_MCU_FLASH/20210113184239_CC3235SF_SFProject.tar, size=235520

OtaArchive_Init: OTA archive version = OTA_ARCHIVE_2.0.0.4

OtaArchive_CheckVersion: current version str = 20200831111705, decimal = 1599918617

OtaArchive_CheckVersion: new version str = 20210113184239, decimal = -2002910737

OtaArchive_CheckVersion: newer version update - 20210113184239

OtaRunStep: status from Ota_run: OTA_RUN_STATUS_CHECK_NEWER_VERSION, accept and continue

OtaRunStep: CurrentVersion=20200831111705, NewVersion=20210113184239, Start download ...

OTA_run: Call CdnClient_ReqFileUrl, filename = /OTA_MINI_MCU_FLASH/20210113184239_CC3235SF_SFProject.tar

CdnDropbox_SendReqFileUrl: uri=/2/files/get_temporary_link

HTTP request is:
POST /2/files/get_temporary_link HTTP/1.1
host: api.dropboxapi.com
Authorization: Bearer 2BlOkSA70-oAAAAAAAAAAVXicg9yBFYyUUvr7fyTY1c5y0yx1t5AAAAAAAAAAA
Content-Type: Application/Json
Content-Length: 69

{"path": "/OTA_MINI_MCU_FLASH/20210113184239_CC3235SF_SFProject.tar"}


OtaJson_init: template={"metadata":raw,"link": string} , text={"metadata": {"name": "20210113184239_CC3235SF_SFProject.tar", "path_lower": "/ota_mini_mcu_flash/20210113184239_cc3235sf_sfproject.tar", "path_display": "/OTA_MINI_MCU_FLASH/20210113184239_CC3235SF_SFProject.tar", "id": "id:_-wNSoxI0WAAAAAAAAABVw", "client_modified": "2021-01-13T13:13:49Z", "server_modified": "2021-01-13T13:13:49Z", "rev": "015b8c7e8f0c1ea00000001fc750d20", "size": 235520, "is_downloadable": true, "content_hash": "bb3d58f31df09609a9cc719c6edb7d50271f90b24f9516243210dc1a815939c5"}, "link": "content.dropboxapi.com/.../ApFbw71tii-sxJgAtNXtxpnpssB9zUP2Gseq8K6Qyyryttf-Y35lhLnSHO1kemDtPrphbjopM4cmMZTRShqSFTYefVyFtICAKUBW8bHf1LKQEdSq8i_juw1zehFb2d7CcDdd-H9CwEKUHi9RYCjwvgiHn70wdJE1Gzfa64rf0QAE-PZM9IRbcsphlNZXyQwKva5lqa2-GsCkBgYmNnYLxorcVTc6y-9-Lk1kdmTY_zvq5UrXJwMcSfdggqaecr0AgzergvKUhia1zuOgZGmm7-B8sA8-IcGF1MFaZXpd-04N5ysFMkVUUTWfW1Ey5ViIAdQzWHeBAYwx3-3YqEEk6P6bZ7CvMu74j3AvBYlAguTy-pxUY-
OTA_run: Call CdnClient_ConnectFileServer, url = content.dropboxapi.com/.../ApFbw71tii-sxJgAtNXtxpnpssB9zUP2Gseq8K6Qyyryttf-Y35lhLnSHO1kemDtPrphbjopM4cmMZTRShqSFTYefVyFtICAKUBW8bHf1LKQEdSq8i_juw1zehFb2d7CcDdd-H9CwEKUHi9RYCjwvgiHn70wdJE1Gzfa64rf0QAE-PZM9IRbcsphlNZXyQwKva5lqa2-GsCkBgYmNnYLxorcVTc6y-9-Lk1kdmTY_zvq5UrXJwMcSfdggqaecr0AgzergvKUhia1zuOgZGmm7-B8sA8-IcGF1MFaZXpd-04N5ysFMkVUUTWfW1Ey5ViIAdQzWHeBAYwx3-3YqEEk6P6bZ7CvMu74j3AvBYlAguTy-

HttpClient_Connect: IP_ADDR=162.125.81.14

[SOCK EVENT] - Unexpected Event [20x]


HttpClient_Connect: ERROR Socket Connect, status=-688

CdnClient_ConnectFileServer: ERROR on HttpClient_Connect, Status=-20304

OTA_run: ERROR CdnClient_ConnectFileServer, Status=-20304


_OtaCheckConsecutiveErrors: ConsecutiveOtaErrors=5/5, MAX_CONSECUTIVE_OTA_ERRORS!!!

OtaRunStep: ignore it just for loop testing


ProcessRestartMcu: reset the platform...

and stuck after "ProcessRestartMcu: reset the platform..." line.

Please reply asap.

Thanks in advance,

sarju bhatnagar

  • -688 means you are using the wrong root CA. 

    You can add the following code to Socket Event Handler which will print the required root CA:

    void SimpleLinkSockEventHandler(SlSockEvent_t *pSock)
    {
    ...
    if ( pSock->Event == SL_SOCKET_ASYNC_EVENT)
    {
    switch (pSock->SocketAsyncEvent.SockAsyncData.Type)
    {
    case SL_SSL_NOTIFICATION_WRONG_ROOT_CA:
    /* on socket error Restart OTA */
    UART_PRINT("SL_SOCKET_ASYNC_EVENT: ERROR - WRONG ROOT CA\n\r");
    UART_PRINT("Please install the following Root Certificate:\n\r");
    UART_PRINT(" %s\n\r", pSock->SocketAsyncEvent.SockAsyncData.pExtraInfo);
    break;
    ...
    default:
    /* on socket error Restart OTA */
    UART_PRINT("SL_SOCKET_ASYNC_EVENT socket event %d \n\r", pSock->Event);
    }
    }
    ...
    }
    

    If you created a new dropbox app, make sure the token is selected with no expiration, and that all the read permissions are enabled.

    Br,

    Kobi

  • Thanks for your reply Kobi,

    As you said, "-688 means you are using the wrong root CA. " but this certificate is one which i was using when it was in running condition. I have a separate folder where i kept all working certificate. this is one of them.

    Br,

    sarju

  • Hi Sarju,

    I'm not sure what is the difference comparing to your working environment, but I responded according to the error code.

    Please add the code i've provided above to get details on the required root CA and make sure you use the right one.

    Br,

    Kobi

  • Hi Kobi,

    Thanks you so much for being connected, As you told i have added code, it's here

    void SimpleLinkSockEventHandler(SlSockEvent_t *pSock)
    {
    
        if (pSock->Event == SL_SOCKET_ASYNC_EVENT)
        {
            switch (pSock->SocketAsyncEvent.SockAsyncData.Type)
            {
            case SL_SSL_NOTIFICATION_WRONG_ROOT_CA:
                /* on socket error Restart OTA */
                LOG_MESSAGE("SL_SOCKET_ASYNC_EVENT: ERROR - WRONG ROOT CA\n\r");
                LOG_MESSAGE("Please install the following Root Certificate:\n\r");
                LOG_MESSAGE(" %s\n\r",
                            pSock->SocketAsyncEvent.SockAsyncData.pExtraInfo);
                break;
            default:
                /* on socket error Restart OTA */
                LOG_MESSAGE("SL_SOCKET_ASYNC_EVENT socket event %d \n\r",
                            pSock->Event);
            }
        }
    
        /* This application doesn't work with socket - Events are not expected */
        switch (pSock->Event)
        {
        case SL_SOCKET_TX_FAILED_EVENT:
            switch (pSock->SocketAsyncEvent.SockTxFailData.Status)
            {
            case SL_ERROR_BSD_ECLOSE:
                LOG_MESSAGE("[SOCK ERROR] - close socket (%d) operation "
                            "failed to transmit all queued packets\n\r",
                            pSock->SocketAsyncEvent.SockTxFailData.Sd);
                break;
            default:
                LOG_MESSAGE("[SOCK ERROR] - TX FAILED  :  socket %d , "
                            "reason (%d) \n\n",
                            pSock->SocketAsyncEvent.SockTxFailData.Sd,
                            pSock->SocketAsyncEvent.SockTxFailData.Status);
                break;
            }
            break;
    
        default:
            LOG_MESSAGE("[SOCK EVENT] - Unexpected Event [%x0x]\n\n", pSock->Event);
            break;
        }
    }
    

    and when i ran the code , this is what i got.

    so i searched for DigiCert Global Root CA in my chrome browser. i exported it in both format

    but no luck.

    Even situation got more worst.

    previously at least i was getting URL, that is also gone.

    please do let me know what else should i try to get rid from this issue.

    Thanks

    sarju bhatnagar

  • make sure you update the otauser.h (i.e. the OTA_SERVER_ROOT_CA_CERT definition should much the path +filename of the certificate)  and the rebuild the library and app (make sure that your library is actually linked with the application). 

    If you are able to verify the file content is good (either with openssl or opening it with the Windows "certificate" viewer) than it can only be issue with the file name/path.

    Br,

    Kobi