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.

CC3220S-LAUNCHXL: Battery Powered Smart Lock CCS errors

Part Number: CC3220S-LAUNCHXL
Other Parts Discussed in Thread: UNIFLASH, CC3220S, CC3120

Hi,

So I've been following the instructions from http://www.ti.com/lit/ug/tidue59/tidue59.pdf (pg 28-30) to get the project built in CCS. But I've only gotten a bunch of errors. All my projects have been imported in my CCS workspace and the properties were changed according to the instructions. I've attached the logs of all my errors. How can I get this project up and running in CCS without any problems?

cc2640 build errors.txt

Description	Resource	Path	Location	Type
gmake: *** No rule to make target 'C:/Users/Alex F/Desktop/CCS ws/source/CdnVendors/CdnDropboxV2.c', needed by 'CdnVendors/CdnDropboxV2.obj'.	ota		 	C/C++ Problem
gmake: *** No rule to make target 'C:/Users/Alex F/Desktop/CCS ws/source/CdnVendors/CdnGithub.c', needed by 'CdnVendors/CdnGithub.obj'.	ota		 	C/C++ Problem
gmake: Target 'all' not remade because of errors.	ota		 	C/C++ Problem

Description	Resource	Path	Location	Type
#1965 cannot open source file "pthread.h"	ble_provisioning.c	/wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs	line 45	C/C++ Problem
#1965 cannot open source file "pthread.h"	main_tirtos.c	/wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs	line 40	C/C++ Problem
#1965 cannot open source file "pthread.h"	mqtt_client_cbs.c	/wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs	line 43	C/C++ Problem
#1965 cannot open source file "pthread.h"	network_if.c	/wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs	line 51	C/C++ Problem
#1965 cannot open source file "ti/devices/cc32xx/inc/hw_ints.h"	CC3220S_LAUNCHXL.c	/wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs	line 43	C/C++ Problem
#1965 cannot open source file "ti/drivers/dpl/DebugP.h"	bmi160_support.c	/wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs	line 60	C/C++ Problem
#1965 cannot open source file "ti/drivers/GPIO.h"	sbl_internal.h	/wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs/sbl	line 76	C/C++ Problem
#1965 cannot open source file "ti/drivers/net/wifi/simplelink.h"	sbl_wifi_snp_update.c	/wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs	line 32	C/C++ Problem
#1965 cannot open source file "ti/drivers/net/wifi/simplelink.h"	sl_wifi_callbacks.c	/wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs	line 34	C/C++ Problem
#1965 cannot open source file "ti/drivers/Power.h"	control_task.c	/wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs	line 34	C/C++ Problem
#1965 cannot open source file "ti/drivers/Power.h"	platform.c	/wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs	line 51	C/C++ Problem
#1965 cannot open source file "ti/drivers/SPI.h"	cloud_ota_task.c	/wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs	line 49	C/C++ Problem
#1965 cannot open source file "ti/drivers/UART.h"	sbl_tl.c	/wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs/sbl	line 43	C/C++ Problem
#1965 cannot open source file "unistd.h"	motor_driver_if.c	/wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs	line 42	C/C++ Problem
#1965 cannot open source file "unistd.h"	mqtt_client_task.c	/wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs	line 38	C/C++ Problem
#1965 cannot open source file "unistd.h"	provisioning_task.c	/wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs	line 41	C/C++ Problem
#1965 cannot open source file "unistd.h"	wifi_doorlock_app.c	/wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs	line 52	C/C++ Problem
gmake: *** [ble_provisioning.obj] Error 1	wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs		 	C/C++ Problem
gmake: *** [bmi160_support.obj] Error 1	wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs		 	C/C++ Problem
gmake: *** [CC3220S_LAUNCHXL.obj] Error 1	wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs		 	C/C++ Problem
gmake: *** [cloud_ota_task.obj] Error 1	wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs		 	C/C++ Problem
gmake: *** [control_task.obj] Error 1	wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs		 	C/C++ Problem
gmake: *** [main_tirtos.obj] Error 1	wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs		 	C/C++ Problem
gmake: *** [motor_driver_if.obj] Error 1	wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs		 	C/C++ Problem
gmake: *** [mqtt_client_cbs.obj] Error 1	wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs		 	C/C++ Problem
gmake: *** [mqtt_client_task.obj] Error 1	wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs		 	C/C++ Problem
gmake: *** [network_if.obj] Error 1	wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs		 	C/C++ Problem
gmake: *** [platform.obj] Error 1	wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs		 	C/C++ Problem
gmake: *** [provisioning_task.obj] Error 1	wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs		 	C/C++ Problem
gmake: *** [sbl_wifi_snp_update.obj] Error 1	wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs		 	C/C++ Problem
gmake: *** [sbl/sbl_simplelink.obj] Error 1	wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs		 	C/C++ Problem
gmake: *** [sbl/sbl_tl.obj] Error 1	wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs		 	C/C++ Problem
gmake: *** [sbl/sbl.obj] Error 1	wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs		 	C/C++ Problem
gmake: *** [sl_wifi_callbacks.obj] Error 1	wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs		 	C/C++ Problem
gmake: *** [wifi_doorlock_app.obj] Error 1	wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs		 	C/C++ Problem
gmake: Target 'all' not remade because of errors.	wifi_doorlock_CC3220S_LAUNCHXL_tirtos_ccs		 	C/C++ Problem

  • Hi Jack,

    What SDK versions do you have installed (for both the Wi-Fi SDK, BLE SDK, and all the plugins)? It looks like some of the files are not appearing where the project is expecting them.

    Can you confirm that you copied the wifi_doorlock_... project into the v2.10 SDK before importing it into your workspace?
    If you open the wifi_doorlock_... project and look at the "General -> Products" page/tab, what SDK version is the project referencing?

    For the ota lib, can you make sure all of the files in the CdnVendors folder are correctly linked to the project?

    Thanks,
    Ben M
  • I have the below sdk versions installed. Is it possible to update the projects to these sdk versions?

    simplelink_cc32xx_sdk_2_20_00_10
    simplelink_cc2640r2_sdk_2_20_00_49
    simplelink_sdk_ble_plugin_1_40_00_42
    sail_1_20_00_02

    The wifi_doorlock project is in the sdk before importing into the workspace. It references the sdk versions listed above.

    How can I check that all the files in the Cdn Vendors folder are correctly linked to the project?

  • Hi Jack,

    Yes, it should be possible to update the projects to those SDK versions, but it is not something we plan to do and release at this time. The older SDK versions are what the design is based off of because the software for the design released before the latest simplelink device SDKs. Please download the previous SimpleLink CC32XX and CC2640R2 SDKs to build and run the example out of box.

    If you open up the CdnVendors folder in the ota project and it looks like the following, you should be good:

    If there are warning marks on the file, they are not not linked properly.

    Best Regards,

    Ben M

  • Thanks. It turns out that since my path ws path had a white space, I had to get rid of it. And I shouldn't "copy" the OTA and Simplelink projects into the ws either. I have a few questions regarding Uniflash now.

    According to pg 32, it says I have to include some user files. For eclipsecert.der, I searched up "eclipse.com" on the SSl Scanner. However, I am unsure which file to download from the screenshot below. Can you tell me which file to download?

    Same thing with the digicertca.der (I searched "github.com"). Can you tell me which file I should download?

    I also noticed that otauser.h required this:

    #define OTA_SERVER_ROOT_CA_CERT         "DigCert_High_Assurance_CA.der"

    However, the table on pg 32 didn't specify any user file for this. What should I do about this?

    Lastly, here is what my Uniflash user files page looks like. Can you verify that this looks correct so far?

  • Hi Jack,

    You'll want to download the Root Certificate of each chain (bottom one) because that is what is needed by the device to verify the chain the server sends when establishing the TLS connection.

    I believe the serial number for the eclipse cert that is currently valid should be: 44 af b0 80 d6 a3 27 ba 89 30 39 86 2e f8 40 6b

    The digicert serial number should be: 02 ac 5c 26 6a 0b 40 9b 8f 0b 79 f2 ae 46 25 77

    The OTA_SERVER_ROOT_CA_CERT define just needs to be updated to match the name you give the Github Root CA when you program it to the device's file system. This is how the device knows to use it for that socket. For example, I put the file in the top level directory (where you appear to have the dummy certificate files) and give it the name "digicertca.der" so my define in the otauser.h file looks as follows:

    #define OTA_SERVER_ROOT_CA_CERT         "digicertca.der"

    Yes, your UniFlash user files look correct so far. Once you add the Eclipse IoT Root CA and the Github server Root CA, you should be set.

    Best Regards,

    Ben M

  • Thank you. So I have a few questions in regards to production.

    From pg 32: "The dummy certificates and keys are to be used only for demo and development purposes. It is the responsibility of the developer to get actual certificates and keys for code signing and SSL/TLS when needed."

    Where should I get these actual certificates? What are the recommended place(s) to get these certificates + how do I get them?

    And are there expirations on these certificates that I have to worry about? 

    I also see this near the bottom of pg 37: "Mutual authentication is not supported by the demo, because there is no mechanism configured for the Eclipse broker to identify the CC3220S device. Mutual authentication can be added by the user when using an actual server for production."

    Could you explain how to add mutual authentication?

    Lastly, at the very bottom of pg 37: "The certificate catalog verification step must be disabled when using the certificate playground during development, because it does not include all of the actual trusted root certificate authorities. For a production system, the production certificate catalog must be used and TI recommends enabling both certificate catalog verification and domain name verification."

    Could you also explain how to enable certificate catalog verification and domain name verification?

  • Hi Jack,

    In general, the code signing certificate is necessary for the S and SF devices and must be purchased from one of the certificate authorities supported by the device in order for the secure boot process to work. The list can be found in the readme.html in the SDK where the catalog is located (for the current SDK, simplelink_cc32xx_sdk_2_20_00_10\tools\cc32xx_tools\certificate-catalog). For more information, I recommend you read the Certificate Handling Guide we created:
    http://www.ti.com/lit/swpu332

    Expiry of the certificates should not be an issue. The device can't check this anyway because it can't be guaranteed that every secure application uses the RTC or that the RTC is set to the actual current date/time for every boot.

    Mutual authentication can be enabled by using a server that supports this (setup to verify client based on a certificate that is registered with the server) and by setting the socket options that add the client certificate/private key. Refer to section 6.5.3 of the Network Processor Guide for more information:
    http://www.ti.com/lit/swru455

    The trusted certificate catalog is enabled by default on a socket. For the domain name verification, there is a specific option that can be set with the sl_setsockopt() function that enables this. You'll need to set the option and provide a string containing the domain name you are expecting to connect to. Refer to 6.5.4 and 6.5.6 of the Network Processor Guide above.

    For the MQTT code (where this is applied in the door lock example), it's a little different though. The MQTT library handles setting up the socket for you (with the host driver API), so these settings are controlled through flags in the MQTT client context struct. Check out the flags in Mqtt_ClientCtx at the top of the mqtt_client_task.c file. Note that if you wish to use the domain name verification, you should connect based on the actual address rather than an IP address.

    Best Regards,
    Ben M
  • Thanks. I also had a few more related questions

    For mutual authentication, what servers are recommended for the door lock example that include mutual authentication?

    For this: "The certificate catalog verification step must be disabled when using the certificate playground during development, because it does not include all of the actual trusted root certificate authorities."

    What missing files do I need to add in Uniflash?

    And what code do I need to add in CCS?

    For the Mqtt_ClientCtx port number options shown below, will I have to change these according to a different server - or should I leave them as is?


  • Hi Jack,

    There are no recommendations from our end on what service to use in place of the eclipse IoT. We use eclipse IoT to demonstrate the design because it is easy to bring up and test with. If you are looking for a replacement to use for an actual product, I recommend you check out one of our cloud partners for which we have SDK plugins. You can use the SDK plugins to quickly get up and running with the cloud service.

    If you want to use the catalog verification on the socket connection, you need to move to the production catalog (not the playground catalog). However, you can no longer sign the MCU image with the dummy certificate chain once you move to the production catalog. You will have to have your own code signing certificate to do this.

    Once you are up and running with the production catalog, you only have to remove the MQTT_DEV_NETCONN_OPT_SKIP_CERTIFICATE_CATALOG_VERIFICATION flag from the Mqtt_ClientCtx to have the device perform this step when establishing the connection.

    Those port numbers are typically reserved for MQTT. It's not likely you will have to change them.

    Best,
    Ben M

  • Thanks. And for the OTA certificates in production, where should I get these files? Or should I just use the dummy files?
  • Hi Jack,

    The OTA certificate is not tied to the certificate catalog. You can create your own or purchase them for signing your OTA updates. You should not use any of the dummy files in production because the private key is available to everyone through the SDK.

    Best Regards,
    Ben M
  • When I use my OTA file with a name like "ota_vendor_key.pem", do I have to make any code change to adjust to this file name?
  • The application doesn't reference the private key because it does not need it. It only needs the public key. If you move to your own key pair, you will have to replace the dummy_ota_vendor_cert file with your own certificate and update the OTA library to reference the new file name if it is different.

    Best Regards,
    Ben M
  •  

    Does the door lock example use IPv4 or IPv6? If using IPv4, how can I change it to use IPv6?

  • Hi Jack,

    The door lock example uses IPv4. Please refer to the section 4.3.2 of the CC3120/CC3220 network processor guide for information on IPv6 addresses -

    http://www.ti.com/lit/swru455

    Best,
    Ben M

  • Thanks. I see that the door lock example uses "Simple Network Time Protocol" according to section 2.4.8.2.2 of www.ti.com/.../tidue59.pdf. How can I get the current date and time from this for my own purposes (what code can I use)?

  • Hi Jack,

    The current date and time retrieved by the device using SNTP is used to set the device RTC. The date and time can be read back using the sl_DeviceGet() function from the simplelink host driver API. Refer to section 2.7 of the Network Processor Programmer's guide -

    http://www.ti.com/lit/swru455

    Best,
    Ben M

  • I am trying to test out the door lock example, but I don't know how to get to the "MQTT tool" page on the Wifi Starter Pro app. How can I reach this page?

  • Hi Jack,

    This is not a part of the SimpleLink Wi-Fi Starter Pro mobile app. It is a separate 3rd party MQTT client application. This one is just an example. Any MQTT client that can connect to the eclipse broker should work.

    If you are using an Android smartphone, I recommend checking out MyMQTT. It lets you save topic+message combinations which makes it easy to try out the different functions.

    Best,

    Ben M

  • I tried testing out the OTA. However, it isn't working.

    I get this message in TeraTerm:

    My code in otauser.h is:

    /* Github vendor info */
    #define OTA_VENDOR_ROOT_DIR             "/repos/gearsmotion789/OTA"
    #define OTA_VENDOR_TOKEN                "gearsmotion789"

    My github repo looks like this:

    1. How can I fix this?

    2. It also appears that after the OTA fails, the doorlock program no longer works. I tried publishing another message, but the CC3220 doesn't respond to it. How can I fix this?

  • Hi Jack,

    From your screenshots it looks like you have your OTA_VENDOR_DIR, OTA_VENDOR_ROOT_DIR, and OTA_VENDOR_TOKEN all configured properly.

    Can you open your otauser.h file and see if you have #define SL_ENABLE_OTA_DEBUG_TRACES uncommented? It would help to get more information from the debug messages in the library if possible.

    In this reference, the cloud_ota_task is not designed to fully recover from its error state. You can see from the output that the error prints to the terminal are made by the ReportError() function in cloud_ota_task.c. This function returns a (-1) which causes the OtaTask to enter a while(1) loop (LOOP_FOREVER) where it isn't technically blocked and can hog the scheduler. You should update the task to not enter this loop.

    Best,
    Ben M
  • Benjamin Moore (3729619) I have enabled SL_ENABLE_OTA_DEBUG_TRACES. Here is the debug message:

    Msg Recvd. by client
    
    TOPIC: /cc3220/doorLock/b851851d23c6b19b0b98d92ebe13d5e/LockOTA
    
    PAYLOAD: 0
    
    QOS: 0
    
    [Control Thread] Starting OTA...
    [OTA Task] OtaInit: statistics = 0, 0, 0
    [OTA Task] OtaInit: call Ota_init
    OTA_init: sizeof CdnClient=576, sizeof OtaArchive=7340
    
    OTA_init: sizeof OtaLib_t=10120, sizeof OTA_memBlock=11000
    
    OTA_init: OTA lib version = OTA_LIB_2.0.0.7
    
    OtaArchive_Init: OTA archive version = OTA_ARCHIVE_2.0.0.4
    
    [OTA Task] OtaConfig: call OTA_set EXTLIB_OTA_SET_OPT_SERVER_INFO, ServerName=ap                                                                                                             i.github.com
    [OTA Task] OtaConfig: call OTA_set EXTLIB_OTA_SET_OPT_VENDOR_ID, VendorDir=OTA_C                                                                                                             C3220S
    OTA_run: call CdnClient_ConnectServer OTA server=api.github.com
    
    CdnClient_ConnectServer: HttpClient_Connect api.github.com
    
    HttpClient_Connect: IP_ADDR=192.30.255.116
    
    HttpClient_Connect: WARNING Socket Connect, status=-468, Ignored...
    
    OTA_run: CdnClient_ReqOtaDir, VendorDir=OTA_CC3220S
    
    CdnGithub_SendReqDir: uri=/repos/gearsmotion789/OTA/contents/
    
    len is: 652
    
    After recvAppend pRespBuf is: on789/OTA/blob/master/OTA_CC3220S/20180913200901_C                                                                                                             C3220S_OTA.tar","git_url":"https://api.github.com/repos/gearsmotion789/OTA/git/b                                                                                                             lobs/13c80c86212cefecf03e17fad0f11324288e4513","download_url":"https://raw.githu                                                                                                             busercontent.com/gearsmotion789/OTA/master/OTA_CC3220S/20180913200901_CC3220S_OT                                                                                                             A.tar","type":"file","_links":{"self":"https://api.github.com/repos/gearsmotion7                                                                                                             89/OTA/contents/OTA_CC3220S/20180913200901_CC3220S_OTA.tar?ref=master","git":"ht                                                                                                             tps://api.github.com/repos/gearsmotion789/OTA/git/blobs/13c80c86212cefecf03e17fa                                                                                                             d0f11324288e4513","html":"https://github.com/gearsmotion789/OTA/blob/master/OTA_                                                                                                             CC3220S/20180913200901_CC3220S_OTA.tar"}}]
    
    the entire JSON pRespBuf is: [{"name":"20180913200901_CC3220S_OTA.tar","path":"O                                                                                                             TA_CC3220S/20180913200901_CC3220S_OTA.tar","sha":"13c80c86212cefecf03e17fad0f113                                                                                                             24288e4513","size":235520,"url":"https://api.github.com/repos/gearsmotion789/OTA                                                                                                             /contents/OTA_CC3220S/20180913200901_CC3220S_OTA.tar?ref=master","html_url":"htt                                                                                                             ps://github.com/gearsmotion789/OTA/blob/master/OTA_CC3220S/20180913200901_CC3220                                                                                                             S_OTA.tar","git_url":"https://api.github.com/repos/gearsmotion789/OTA/git/blobs/                                                                                                             13c80c86212cefecf03e17fad0f11324288e4513","download_url":"https://raw.githubuser                                                                                                             content.com/gearsmotion789/OTA/master/OTA_CC3220S/20180913200901_CC3220S_OTA.tar                                                                                                             ","type":"file","_links":{"self":"https://api.github.com/repos/gearsmotion789/OT                                                                                                             A/contents/OTA_CC3220S/20180913200901_CC3220S
    [OtaJson_getMetadataFileName] Error: -101  , Couldn't get the data
    
    OTA_run: ERROR CdnClient_ReqOtaDir, Status=-101
    
    
    _OtaCheckConsecutiveErrors: ConsecutiveOtaErrors=1/5, return only WARNNING
    
    [OTA Task] OtaRunStep: WARNING Ota_run, Status=20004, continue for next OTA retr                                                                                                             y
    OTA_run: call CdnClient_ConnectServer OTA server=api.github.com
    
    CdnClient_ConnectServer: HttpClient_Connect api.github.com
    
    HttpClient_Connect: IP_ADDR=192.30.255.117
    
    HttpClient_Connect: WARNING Socket Connect, status=-468, Ignored...
    
    OTA_run: CdnClient_ReqOtaDir, VendorDir=OTA_CC3220S
    
    CdnGithub_SendReqDir: uri=/repos/gearsmotion789/OTA/contents/
    
    len is: 652
    
    After recvAppend pRespBuf is: on789/OTA/blob/master/OTA_CC3220S/20180913200901_C                                                                                                             C3220S_OTA.tar","git_url":"https://api.github.com/repos/gearsmotion789/OTA/git/b                                                                                                             lobs/13c80c86212cefecf03e17fad0f11324288e4513","download_url":"https://raw.githu                                                                                                             busercontent.com/gearsmotion789/OTA/master/OTA_CC3220S/20180913200901_CC3220S_OT                                                                                                             A.tar","type":"file","_links":{"self":"https://api.github.com/repos/gearsmotion7                                                                                                             89/OTA/contents/OTA_CC3220S/20180913200901_CC3220S_OTA.tar?ref=master","git":"ht                                                                                                             tps://api.github.com/repos/gearsmotion789/OTA/git/blobs/13c80c86212cefecf03e17fa                                                                                                             d0f11324288e4513","html":"https://github.com/gearsmotion789/OTA/blob/master/OTA_                                                                                                             CC3220S/20180913200901_CC3220S_OTA.tar"}}]
    
    the entire JSON pRespBuf is: [{"name":"20180913200901_CC3220S_OTA.tar","path":"O                                                                                                             TA_CC3220S/20180913200901_CC3220S_OTA.tar","sha":"13c80c86212cefecf03e17fad0f113                                                                                                             24288e4513","size":235520,"url":"https://api.github.com/repos/gearsmotion789/OTA                                                                                                             /contents/OTA_CC3220S/20180913200901_CC3220S_OTA.tar?ref=master","html_url":"htt                                                                                                             ps://github.com/gearsmotion789/OTA/blob/master/OTA_CC3220S/20180913200901_CC3220                                                                                                             S_OTA.tar","git_url":"https://api.github.com/repos/gearsmotion789/OTA/git/blobs/                                                                                                             13c80c86212cefecf03e17fad0f11324288e4513","download_url":"https://raw.githubuser                                                                                                             content.com/gearsmotion789/OTA/master/OTA_CC3220S/20180913200901_CC3220S_OTA.tar                                                                                                             ","type":"file","_links":{"self":"https://api.github.com/repos/gearsmotion789/OT                                                                                                             A/contents/OTA_CC3220S/20180913200901_CC3220S
    [OtaJson_getMetadataFileName] Error: -101  , Couldn't get the data
    
    OTA_run: ERROR CdnClient_ReqOtaDir, Status=-101
    
    
    _OtaCheckConsecutiveErrors: ConsecutiveOtaErrors=2/5, return only WARNNING
    
    [OTA Task] OtaRunStep: WARNING Ota_run, Status=20004, continue for next OTA retr                                                                                                             y
    OTA_run: call CdnClient_ConnectServer OTA server=api.github.com
    
    CdnClient_ConnectServer: HttpClient_Connect api.github.com
    
    HttpClient_Connect: IP_ADDR=192.30.255.117
    
    HttpClient_Connect: WARNING Socket Connect, status=-468, Ignored...
    
    OTA_run: CdnClient_ReqOtaDir, VendorDir=OTA_CC3220S
    
    CdnGithub_SendReqDir: uri=/repos/gearsmotion789/OTA/contents/
    
    len is: 582
    
    After recvAppend pRespBuf is: _url":"https://api.github.com/repos/gearsmotion789                                                                                                             /OTA/git/blobs/13c80c86212cefecf03e17fad0f11324288e4513","download_url":"https:/                                                                                                             /raw.githubusercontent.com/gearsmotion789/OTA/master/OTA_CC3220S/20180913200901_                                                                                                             CC3220S_OTA.tar","type":"file","_links":{"self":"https://api.github.com/repos/ge                                                                                                             arsmotion789/OTA/contents/OTA_CC3220S/20180913200901_CC3220S_OTA.tar?ref=master"                                                                                                             ,"git":"https://api.github.com/repos/gearsmotion789/OTA/git/blobs/13c80c86212cef                                                                                                             ecf03e17fad0f11324288e4513","html":"https://github.com/gearsmotion789/OTA/blob/m                                                                                                             aster/OTA_CC3220S/20180913200901_CC3220S_OTA.tar"}}]
    
    the entire JSON pRespBuf is: [{"name":"20180913200901_CC3220S_OTA.tar","path":"O                                                                                                             TA_CC3220S/20180913200901_CC3220S_OTA.tar","sha":"13c80c86212cefecf03e17fad0f113                                                                                                             24288e4513","size":235520,"url":"https://api.github.com/repos/gearsmotion789/OTA                                                                                                             /contents/OTA_CC3220S/20180913200901_CC3220S_OTA.tar?ref=master","html_url":"htt                                                                                                             ps://github.com/gearsmotion789/OTA/blob/master/OTA_CC3220S/20180913200901_CC3220                                                                                                             S_OTA.tar","git_url":"https://api.github.com/repos/gearsmotion789/OTA/git/blobs/                                                                                                             13c80c86212cefecf03e17fad0f11324288e4513","download_url":"https://raw.githubuser                                                                                                             content.com/gearsmotion789/OTA/master/OTA_CC3220S/20180913200901_CC3220S_OTA.tar                                                                                                             ","type":"file","_links":{"self":"https://api.github.com/repos/gearsmotion789/OT                                                                                                             A/contents/OTA_CC3220S/20180913200901_CC3220S
    [OtaJson_getMetadataFileName] Error: -101  , Couldn't get the data
    
    OTA_run: ERROR CdnClient_ReqOtaDir, Status=-101
    
    
    _OtaCheckConsecutiveErrors: ConsecutiveOtaErrors=3/5, return only WARNNING
    
    [OTA Task] OtaRunStep: WARNING Ota_run, Status=20004, continue for next OTA retr                                                                                                             y
    OTA_run: call CdnClient_ConnectServer OTA server=api.github.com
    
    CdnClient_ConnectServer: HttpClient_Connect api.github.com
    
    HttpClient_Connect: IP_ADDR=192.30.255.117
    
    HttpClient_Connect: WARNING Socket Connect, status=-468, Ignored...
    
    OTA_run: CdnClient_ReqOtaDir, VendorDir=OTA_CC3220S
    
    CdnGithub_SendReqDir: uri=/repos/gearsmotion789/OTA/contents/
    
    len is: 652
    
    After recvAppend pRespBuf is: on789/OTA/blob/master/OTA_CC3220S/20180913200901_C                                                                                                             C3220S_OTA.tar","git_url":"https://api.github.com/repos/gearsmotion789/OTA/git/b                                                                                                             lobs/13c80c86212cefecf03e17fad0f11324288e4513","download_url":"https://raw.githu                                                                                                             busercontent.com/gearsmotion789/OTA/master/OTA_CC3220S/20180913200901_CC3220S_OT                                                                                                             A.tar","type":"file","_links":{"self":"https://api.github.com/repos/gearsmotion7                                                                                                             89/OTA/contents/OTA_CC3220S/20180913200901_CC3220S_OTA.tar?ref=master","git":"ht                                                                                                             tps://api.github.com/repos/gearsmotion789/OTA/git/blobs/13c80c86212cefecf03e17fa                                                                                                             d0f11324288e4513","html":"https://github.com/gearsmotion789/OTA/blob/master/OTA_                                                                                                             CC3220S/20180913200901_CC3220S_OTA.tar"}}]
    
    the entire JSON pRespBuf is: [{"name":"20180913200901_CC3220S_OTA.tar","path":"O                                                                                                             TA_CC3220S/20180913200901_CC3220S_OTA.tar","sha":"13c80c86212cefecf03e17fad0f113                                                                                                             24288e4513","size":235520,"url":"https://api.github.com/repos/gearsmotion789/OTA                                                                                                             /contents/OTA_CC3220S/20180913200901_CC3220S_OTA.tar?ref=master","html_url":"htt                                                                                                             ps://github.com/gearsmotion789/OTA/blob/master/OTA_CC3220S/20180913200901_CC3220                                                                                                             S_OTA.tar","git_url":"https://api.github.com/repos/gearsmotion789/OTA/git/blobs/                                                                                                             13c80c86212cefecf03e17fad0f11324288e4513","download_url":"https://raw.githubuser                                                                                                             content.com/gearsmotion789/OTA/master/OTA_CC3220S/20180913200901_CC3220S_OTA.tar                                                                                                             ","type":"file","_links":{"self":"https://api.github.com/repos/gearsmotion789/OT                                                                                                             A/contents/OTA_CC3220S/20180913200901_CC3220S
    [OtaJson_getMetadataFileName] Error: -101  , Couldn't get the data
    
    OTA_run: ERROR CdnClient_ReqOtaDir, Status=-101
    
    
    _OtaCheckConsecutiveErrors: ConsecutiveOtaErrors=4/5, return only WARNNING
    
    [OTA Task] OtaRunStep: WARNING Ota_run, Status=20004, continue for next OTA retr                                                                                                             y
    OTA_run: call CdnClient_ConnectServer OTA server=api.github.com
    
    CdnClient_ConnectServer: HttpClient_Connect api.github.com
    
    HttpClient_Connect: IP_ADDR=192.30.255.116
    
    HttpClient_Connect: WARNING Socket Connect, status=-468, Ignored...
    
    OTA_run: CdnClient_ReqOtaDir, VendorDir=OTA_CC3220S
    
    CdnGithub_SendReqDir: uri=/repos/gearsmotion789/OTA/contents/
    
    len is: 652
    
    After recvAppend pRespBuf is: on789/OTA/blob/master/OTA_CC3220S/20180913200901_C                                                                                                             C3220S_OTA.tar","git_url":"https://api.github.com/repos/gearsmotion789/OTA/git/b                                                                                                             lobs/13c80c86212cefecf03e17fad0f11324288e4513","download_url":"https://raw.githu                                                                                                             busercontent.com/gearsmotion789/OTA/master/OTA_CC3220S/20180913200901_CC3220S_OT                                                                                                             A.tar","type":"file","_links":{"self":"https://api.github.com/repos/gearsmotion7                                                                                                             89/OTA/contents/OTA_CC3220S/20180913200901_CC3220S_OTA.tar?ref=master","git":"ht                                                                                                             tps://api.github.com/repos/gearsmotion789/OTA/git/blobs/13c80c86212cefecf03e17fa                                                                                                             d0f11324288e4513","html":"https://github.com/gearsmotion789/OTA/blob/master/OTA_                                                                                                             CC3220S/20180913200901_CC3220S_OTA.tar"}}]
    
    the entire JSON pRespBuf is: [{"name":"20180913200901_CC3220S_OTA.tar","path":"O                                                                                                             TA_CC3220S/20180913200901_CC3220S_OTA.tar","sha":"13c80c86212cefecf03e17fad0f113                                                                                                             24288e4513","size":235520,"url":"https://api.github.com/repos/gearsmotion789/OTA                                                                                                             /contents/OTA_CC3220S/20180913200901_CC3220S_OTA.tar?ref=master","html_url":"htt                                                                                                             ps://github.com/gearsmotion789/OTA/blob/master/OTA_CC3220S/20180913200901_CC3220                                                                                                             S_OTA.tar","git_url":"https://api.github.com/repos/gearsmotion789/OTA/git/blobs/                                                                                                             13c80c86212cefecf03e17fad0f11324288e4513","download_url":"https://raw.githubuser                                                                                                             content.com/gearsmotion789/OTA/master/OTA_CC3220S/20180913200901_CC3220S_OTA.tar                                                                                                             ","type":"file","_links":{"self":"https://api.github.com/repos/gearsmotion789/OT                                                                                                             A/contents/OTA_CC3220S/20180913200901_CC3220S
    [OtaJson_getMetadataFileName] Error: -101  , Couldn't get the data
    
    OTA_run: ERROR CdnClient_ReqOtaDir, Status=-101
    
    
    _OtaCheckConsecutiveErrors: ConsecutiveOtaErrors=5/5, MAX_CONSECUTIVE_OTA_ERRORS                                                                                                             !!!
    
    [OTA Task] OtaRunStep: FATAL ERROR from Ota_run -21003 !!!!!!!!!!!!!!!!!!!!!!!!!                                                                                                             !!
             [OTA Task] Test failed: Unknown event
             [OTA Task] Event handler failed..!!

  • Hi Jack,

    If you take a look at the output in the log, the process seems to fail when parsing the metadata returned by Github for the file name. The file you uploaded exists as expected in the metadata, but there seems to be an error extracting it from the buffer.

    I'm thinking this is related to the length of the returned buffer. It could be that it is longer than the maximum size that the device expects, which is why it isn't properly identifying the file name.

    What do you have #define MAX_METADATA_FILENAME set to in OtaJson.c?

    Thanks,

    Ben M

  • I have it set to 100. Below is some more info.

  • Hi Jack,

    Please try increasing it. You can start by testing 150, but you may need to go higher since that value was based on my demo with Dropbox. The formatting of the metadata may be slightly different/longer.


    Best,
    Ben M

  •  Thanks. It works now.

    1. So going back to when OTA fails, when I removed the Loop_Forever statement, the program still continues to run. However, when I try to do OTA again, all I get is the below. Nothing happens. How can I fix this?

    2. Also, I noticed that when I reset the CC3220S launchpad and then check the status, it is reset back to the "unlocked state". How can I get it to save the last state it was in even after reset?

    3. Lastly, I noticed that the time zone is set incorrectly in the program. I don't live in "Central Time Zone". Where can I change this parameter in the code?

  • Hi Jack,

    1. After changing the OTA task to not get stuck on a failure, please be sure you implement a mechanism to reset the OTA state machine to the state where it is waiting for a message to trigger the update attempt.

    2. You can change the example by (a) adding a mechanism to detect the lock state on startup and write that to the value or (b) store the last known state in a file on the file system (if that is all you need for your test).

    3. The time zone is statically defined in the example, not dynamically set based on some other information that the system receives. Update the get time function to use the time zone define that is appropriate for you when performing SNTP

    Best,
    Ben M

  • 1. Do you have sample code to "reset the OTA state machine to the state where it is waiting for a message to trigger the update attempt"?
    2. Do you have sample code to "store the last known state in a file on the file system"?
    3. When you say "time zone is statically defined in the example", what is this definition called, and in which file is it located in?
  • Hi Jack,

    1. No. You will have to handle implementing this.
    2. Check out chapter 7 of the network processor programmer's guide for examples on how to use the file system module of the host driver API
    3. The definition is CLOCKSYNC_TIMEZONE_CENTRAL inside the SetTime() function of network_if.c

    Best,
    Ben M
  • For 1, do you know what code in the "cloud ota" sample allows for OTA reset? This way I can use that code for the lock sample code.

  • Hi Jack,

    The cloud ota example is similarly designed such that an error code from an event handler can lead to the application ending up in a while(1). You should design the task to reset according to your application needs. In general, you'll want to stop the asynchronous timer used by the thread, clear any events from the queue, and reset the context to the idle state (or one of the waiting states depending on the connection status).

    For more information on the ota library and process, you can refer to the OTA application report -
    http://www.ti.com/lit/swra510

    Best,
    Ben M


  • The cloud ota example doesn't get stuck if no tar is found on github. However, the door lock example gets stuck if no tar is found on github. That is why I wanted to ask what code the cloud ota used to restart. Do you know why this is so? What is the code in the cloud ota that the door lock doesn't have?