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.

RTOS/CC3220MOD: Cloud OTA keeps failing when trying to reach the server

Part Number: CC3220MOD
Other Parts Discussed in Thread: CC3200

Tool/software: TI-RTOS

I am trying to get the cloud OTA update working on the CC3220MODSF. I have the profiling working, and I can connect to the station and pass the ping tests. When I start the OTA update, I get to the point where I look to the cloud server. I keep getting the error OTA_RUN_STATUS_CONTINUE_WARNING_FAILED_CONNECT_FILE_SERVER returned back, but I have no clue what I am doing wrong. I followed the instructions listed in SWRA510.pdf, but I still get stuck at this error. Can someone help guide me through this issue? I am guessing I am missing something obvious, but I don't see it at this point. If I find a solution I will come back to update.

  • Hi Bryan,

    Please enable the OTA debug ("#define SL_ENABLE_OTA_DEBUG_TRACES" in "ota_user.h" and then recompile the ota library and the sample application) and share the UART debug log.

    You may also refer to the OTA training (dev.ti.com/.../

    br,
    Kobi
  • I have some of my own debug code in, but this is what I saw:

    ******* OTA Switch Pressed - Run OTA Process *******
    LED's TIMER!
    BUTTON TIMER!
    SimpleLinkPingReport
    Ping done. Success rate: 100%

    SignalOTAEvent
    Event: 8!!!
    StopAsyncEvtTimer
    HandlePingComplete
    OtaCheckAndDoCommit
    HandlePingComplete: OTA Command arrived
    SignalOTAEvent
    Start of OTA update loop!
    Event: 9!!!
    StopAsyncEvtTimer
    OtaInit
    StopAsyncEvtTimer
    OtaInit: statistics = 0, 0, 0
    OtaInit: call Ota_init
    OTA_init: sizeof CdnClient=576, sizeof OtaArchive=4404
    OTA_init: sizeof OtaLib_t=7184, sizeof OTA_memBlock=7800
    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.dropbox.com
    OtaConfig: call OTA_set EXTLIB_OTA_SET_OPT_VENDOR_ID, VendorDir=OTA_MAGNETEK
    SignalOTAEvent
    3. Changing states: 6!!!
    Start of OTA update loop!
    Event: 10!!!
    StopAsyncEvtTimer
    OtaRunStep
    SignalOTAEvent
    Start of OTA update loop!
    Event: 10!!!
    StopAsyncEvtTimer
    OtaRunStep
    OTA_run: call CdnClient_ConnectServer OTA server=api.dropbox.com
    CdnClient_ConnectServer: HttpClient_Connect api.dropbox.com
    HttpClient_Connect: IP_ADDR=162.125.3.7
    HttpClient_Connect: ERROR Socket Connect, status=-456
    CdnClient_ConnectServer: ERROR HttpClient_Connect, Status=-20304
    OTA_run: ERROR CdnClient_ConnectServer, Status=-20304

    _OtaCheckConsecutiveErrors: ConsecutiveOtaErrors=1/5, return only WARNNING
    OtaRunStep: WARNING Ota_run, Status=20006, continue for next OTA retry

    SignalOTAEvent
    Start of OTA update loop!
    Event: 10!!!
    StopAsyncEvtTimer
    OtaRunStep
    SignalOTAEvent
    Start of OTA update loop!
    Event: 10!!!
    StopAsyncEvtTimer
    OtaRunStep
    OTA_run: call CdnClient_ConnectServer OTA server=api.dropbox.com
    CdnClient_ConnectServer: HttpClient_Connect api.dropbox.com
    HttpClient_Connect: IP_ADDR=162.125.3.7
    HttpClient_Connect: ERROR Socket Connect, status=-456
    CdnClient_ConnectServer: ERROR HttpClient_Connect, Status=-20304
    OTA_run: ERROR CdnClient_ConnectServer, Status=-20304

    _OtaCheckConsecutiveErrors: ConsecutiveOtaErrors=2/5, return only WARNNING
    OtaRunStep: WARNING Ota_run, Status=20006, continue for next OTA retry

    SignalOTAEvent
    Start of OTA update loop!
    Event: 10!!!
    StopAsyncEvtTimer
    OtaRunStep
    SignalOTAEvent
    Start of OTA update loop!
    Event: 10!!!
    StopAsyncEvtTimer
    OtaRunStep
    OTA_run: call CdnClient_ConnectServer OTA server=api.dropbox.com
    CdnClient_ConnectServer: HttpClient_Connect api.dropbox.com
    HttpClient_Connect: IP_ADDR=162.125.3.7
    HttpClient_Connect: ERROR Socket Connect, status=-456
    CdnClient_ConnectServer: ERROR HttpClient_Connect, Status=-20304
    OTA_run: ERROR CdnClient_ConnectServer, Status=-20304

    _OtaCheckConsecutiveErrors: ConsecutiveOtaErrors=3/5, return only WARNNING
    OtaRunStep: WARNING Ota_run, Status=20006, continue for next OTA retry

    SignalOTAEvent
    Start of OTA update loop!
    Event: 10!!!
    StopAsyncEvtTimer
    OtaRunStep
    SignalOTAEvent
    Start of OTA update loop!
    Event: 10!!!
    StopAsyncEvtTimer
    OtaRunStep
    OTA_run: call CdnClient_ConnectServer OTA server=api.dropbox.com
    CdnClient_ConnectServer: HttpClient_Connect api.dropbox.com
    HttpClient_Connect: IP_ADDR=162.125.3.7
    HttpClient_Connect: ERROR Socket Connect, status=-456
    CdnClient_ConnectServer: ERROR HttpClient_Connect, Status=-20304
    OTA_run: ERROR CdnClient_ConnectServer, Status=-20304

    _OtaCheckConsecutiveErrors: ConsecutiveOtaErrors=4/5, return only WARNNING
    OtaRunStep: WARNING Ota_run, Status=20006, continue for next OTA retry

    SignalOTAEvent
    Start of OTA update loop!
    Event: 10!!!
    StopAsyncEvtTimer
    OtaRunStep
    SignalOTAEvent
    Start of OTA update loop!
    Event: 10!!!
    StopAsyncEvtTimer
    OtaRunStep
    OTA_run: call CdnClientLED's TIMER!
    _ConnectServer OTA server=api.dropbox.com
    CdnClient_ConnectServer: HttpClient_Connect api.dropbox.com
    HttpClient_Connect: IP_ADDR=162.125.3.7
    HttpClient_Connect: ERROR Socket Connect, status=-456
    CdnClient_ConnectServer: ERROR HttpClient_Connect, Status=-20304
    OTA_run: ERROR CdnClient_ConnectServer, Status=-20304

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

    OtaRunStep: FATAL ERROR from Ota_run -21003 !!!!!!!!!!!!!!!!!!!!!!!!!!!

    SignalOTAEvent
    Start of OTA update loop!
    Event: 13!!!
    StopAsyncEvtTimer
    ReportError
    Test failed: State = 6, Event = 17
    Event handler failed..!!

  • I am guessing this is due to a bad CA file, but I don't know what I could do to fix that.
  • I followed the post here:
    e2e.ti.com/.../372579

    I am now getting a SL_ERROR_BSD_ESEC_ASN_NO_SIGNER_E error. I will continue to update as I determine what is wrong.
  • So I went the resource explorer and walked through the OTA description. I had the console print out the certification I need, so that helped a lot. However, when I tried to use that certificate, I then got the OTA_RUN_STATUS_CONTINUE_WARNING_FAILED_CONNECT_FILE_SERVER error again. What could be going wrong here?
  • Hi Bryan,

    SL_ERROR_BSD_ESECBADCERTFILE (-456) – either the certificate file was not found (e.g. due to wrong file name) or it is the wrong one for the connection (i.e. need to install a different certificate).
    Where did you put the server's root CA certificate? you should set the full path (case sensitive) for the "OTA_SERVER_ROOT_CA_CERT" definition.
    Root certificate for Dropbox should be "GoDaddy_class2_CA.der".

    I'm not sure in regards to your latest status, but if you have different low-level error, please specify it or provide new debug log.

    Br,
    Kobi
  • Here is the latest log:

    OTA_init: sizeof CdnClient=576, sizeof OtaArchive=4404
    OTA_init: sizeof OtaLib_t=7184, sizeof OTA_memBlock=7800
    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.dropbox.com
    OtaConfig: call OTA_set EXTLIB_OTA_SET_OPT_VENDOR_ID, VendorDir=OTA_MAGNETEK
    SignalOTAEvent
    3. Changing states: 6!!!
    Start of OTA update loop!
    Event: 10!!!
    StopAsyncEvtTimer
    OtaRunStep
    SignalOTAEvent
    Start of OTA update loop!
    Event: 10!!!
    StopAsyncEvtTimer
    OtaRunStep
    OTA_run: call CdnClient_ConnectServer OTA server=api.dropbox.com
    CdnClient_ConnectServer: HttpClient_Connect api.dropbox.com
    HttpClient_Connect: IP_ADDR=162.125.3.7
    SimpleLinkSockEventHandler
    SignalOTAEvent
    [SOCK ERROR] an event received on socket 0
    [SOCK ERROR] Used wrong CA to verify the peer.
    Please install the following Root Certificate:
    DigiCert High Assurance EV Root CA
    [SOCK EVENT] - Unexpected Event [20x]

    SignalOTAEvent
    HttpClient_Connect: ERROR Socket Connect, status=-688
    CdnClient_ConnectServer: ERROR HttpClient_Connect, Status=-20304
    OTA_run: ERROR CdnClient_ConnectServer, Status=-20304

    _OtaCheckConsecutiveErrors: ConsecutiveOtaErrors=1/5, return only WARNNING
    OtaRunStep: WARNING Ota_run, Status=20006, continue for next OTA retry

    SignalOTAEvent
    Start of OTA update loop!
    Event: 16!!!
    StopAsyncEvtTimer


    ProcessRestartMcu: reset the platform...
  • I am using Dropbox, the certificating it's looking for is as if I am using Github (based on the example).
  • Sorry for the large amount of posts, but I am making progress. Now I have the following output:

    OtaInit: call Ota_init
    OTA_init: sizeof CdnClient=576, sizeof OtaArchive=4404
    OTA_init: sizeof OtaLib_t=7184, sizeof OTA_memBlock=7800
    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.dropbox.com
    OtaConfig: call OTA_set EXTLIB_OTA_SET_OPT_VENDOR_ID, VendorDir=OTA_MAGNETEK
    SignalOTAEvent
    3. Changing states: 6!!!
    Start of OTA update loop!
    Event: 10!!!
    StopAsyncEvtTimer
    OtaRunStep
    SignalOTAEvent
    Start of OTA update loop!
    Event: 10!!!
    StopAsyncEvtTimer
    OtaRunStep
    OTA_run: call CdnClient_ConnectServer OTA server=api.dropbox.com
    CdnClient_ConnectServer: HttpClient_Connect api.dropbox.com
    HttpClient_Connect: IP_ADDR=162.125.3.7
    LED's TIMER!
    HttpClient_Connect: WARNING Socket Connect, status=-468, Ignored...
    SignalOTAEvent
    Start of OTA update loop!
    Event: 10!!!
    StopAsyncEvtTimer
    OtaRunStep
    OTA_run: CdnClient_ReqOtaDir, VendorDir=OTA_MAGNETEK
    CdnDropbox_SendReqDir: uri=/1/metadata/auto/
    HttpClient_RecvSkipHdr: http error code HTTP/1.1 404
    CdnDropbox_ParseRespDir: ERROR HttpClient_RecvSkipHdr, status=-20310
    OTA_run: ERROR CdnClient_ReqOtaDir, Status=-20310

    _OtaCheckConsecutiveErrors: ConsecutiveOtaErrors=1/5, return only WARNNING
    OtaRunStep: WARNING Ota_run, Status=20004, continue for next OTA retry
  • Please try using the OTA_SERVER_DROPBOX_V2 to connect to Dropbox.
  • Okay, I'm trying that now. I'll update in a few minutes what I find.
  • I ran into the same error, but the http error code changed:

    OtaInit: call Ota_init
    OTA_init: sizeof CdnClient=576, sizeof OtaArchive=4404
    OTA_init: sizeof OtaLib_t=7184, sizeof OTA_memBlock=7800
    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_MAGNETEK
    SignalOTAEvent
    3. Changing states: 6!!!
    Start of OTA update loop!
    Event: 10!!!
    StopAsyncEvtTimer
    OtaRunStep
    SignalOTAEvent
    Start of OTA update loop!
    Event: 10!!!
    StopAsyncEvtTimer
    OtaRunStep
    OTA_run: call CdnClient_ConnectServer OTA server=api.dropboxapi.com
    CdnClient_ConnectServer: HttpClient_Connect api.dropboxapi.com
    HttpClient_Connect: IP_ADDR=162.125.3.7
    LED's TIMER!
    HttpClient_Connect: WARNING Socket Connect, status=-468, Ignored...
    SignalOTAEvent
    Start of OTA update loop!
    Event: 10!!!
    StopAsyncEvtTimer
    OtaRunStep
    OTA_run: CdnClient_ReqOtaDir, VendorDir=OTA_MAGNETEK
    CdnDropbox_SendReqDir: uri=/2/files/list_folder
    HttpClient_RecvSkipHdr: http error code HTTP/1.1 409
    CdnDropbox_ParseRespDir: ERROR HttpClient_RecvSkipHdr, status=-20310
    OTA_run: ERROR CdnClient_ReqOtaDir, Status=-20310

    _OtaCheckConsecutiveErrors: ConsecutiveOtaErrors=1/5, return only WARNNING
    OtaRunStep: WARNING Ota_run, Status=20004, continue for next OTA retry
  • We have been working with Victor Salomon at TI through our development. If it would make the debugging process easier, he can give you a phone number to reach me. We are building a new product and wanted to use the CC3200, but the calibration currents were too high, and steered us towards the CC3220.
  • Hi Bryan,

    It seems like the connection to the server is ok (if you used the "production" certificate catalog (under "tools\cc32xx_tools\certificate-catalog\"), you would eliminate the -468 warning.
    Now you have problem with the getting the list of contents from you dropbox project.
    Please follow carefully the instructions in the training for setting up your Dropbox Apps project.
    If you use the right vendor (access) token and right sub folder name, you should be ok.
    If more help is needed, please send me the screen shots from your dropbox project and your "otauser.h" (you can do so through Victor).

    Br,
    Kobi
  • I am using the correct certificate file for the MCU image. I will generate a new token from Dropbox and see if that helps. Could you contact Victor to get an email chain started? I can update this forum post once we find a solution.
  • I was using the Dropbox app folder as my directory folder. Once I added in another level to the app, OTA updates were working.