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.

Location of WLAN profiles in EEPROM on CC3000



Hi,

Does anybody know the File ID or address of where the WLAN profiles are stored in EEPROM?  I am trying to debug some issues and need to know this information.  All I can get from the documentation is that it is stored somewhere in the EEPROM.  I would also like to know the format of the data so I can decode it.

Thanks,

Brent

  • Hi,

    These profiles are stored in File ID #2 (the WLAN) but unfortunately there are no APIs for managing the profiles.

    Shlomi

  • Thanks Shiomi for addressing my post.  This helps me get started.  I could write my own API but I would need some information regarding the profile.  Is there any kind of documentation that indicates the format of the stored profile?

    Also, while I have your attention, the reason I need this is to help debug a smart config problem I have.  When I start smart config, it never returns a response.  Do you know if anything exists to help understand where it is getting stuck?  There are just too many issues to address and they are all under the umbrella of the CC3000 and I have no way to look into it to find what is going on.  Any help would be great.

    Thanks,

    Brent

  • Brent,

    There is no API for managing profiles, thus, no documentation exists.

    But it is good to understand the motivation. Can you provide more details on the failure of Smart Config?

    • did you ever managed to successfuly operate it?
    • what is the configuring device you are using (Android, iPhone, PC using a java aplet)?
    • what is the AP you are trying to connect to? Are there APs in which you can connect to?
    • Is the AP secured? can you try an open AP just to make sure it is not a security issue?

    In addition, without logs it is really hard to guess what the problem is.

    Regards,

    Shlomi

     

  • Hi Shlomi,

    To answer your questions:

      I have not been able to successfully operate smart config.  The configuring devices I have used are: windows laptop (both beacon and ad hoc points), mac laptop, and iphone.  I tried to manually create a profile and store it but I ran into stack corruption problems in the host driver code that I have been unable to successfully debug.  The other questions become irrelevant because I have not been able to apply a profile to attempt connecting to.  I have done a scan and found multiple APs that was expected, so that confirms it can at least see and get information over the wireless network.

    With regards to the logger, that sounds very promising and right what I have been looking for.  However, I did look at the link and can not find the UART_DBG pins on the CC3000 module in the CC3000 data sheet.  Are they new pins that have been added?  Are they multiplexed with other pins?  We also have to make sure they are accessible on my board.

    I am currently working on upgrading the patch versions from 1.10.2 to 1.11.  I don't know if that will help but I want to get the latest to make sure.  I hope to have that done today.

    Also, here is a summary I created a week or so ago that I have included here for you reference of what I had done up to that point.  (I have not made much progress since, so it is still quite accurate.)


    I have ported the code and am initialize the CC3000 as described in the CC3000 Serial Port Interface (SPI) document, by initializing the interface and then sending the HCI_CMND_SIMPLE_LINK_START command and the HCI_CMND_READ_BUFFER_SIZE command.  In both cases, I get the command complete as expected.
    I then call the following routines:
    wlan_ioctl_set_connection_policy(0, 0, 0);
    wlan_ioctl_del_profile(255);
    wait until the CC3000 is disconnected
    wlan_smart_config_set_prefix("TTT");
    wlan_smart_config_start(0);

    Everything works as expected.
    I then send a probe as described in the CC3000 First Time Configuration document.
    I then wait for the SIMPLE_CONFIG_DONE flag and I never receive it.  I have tried checking for interrupts and the line from the CC3000 never asserts.

    I have tried several different probes as well as beacons and none of them have worked.  I have also tried passing a 1 to the wlan_smart_config_start with the same results.

    The interrupt line (and ISR) does work since I have seen multiple interrupts during the work I have done.

    I have send other commands (such as reading the MAC address, code version, etc) and they complete as expected.

    Both my MSP430 code and the CC3000 code versions match (1.10).

    I also tried doing a scan using wlan_ioctl_set_scan_params and wlan_ioctl_get_scan_results which returns the expected wireless access points.  So, I know that the CC3000 and antenna combination works and can communicate with the outside world.

    The only thing that appears not to be working at this point is the smart config.

    Thanks,

    Brent

  • Hi Shlomi,

    Is there any chance we can get together on a phone call?  I think it would save us a lot of back and forth and get this resolved much quicker.

    Thanks,

    Brent

  • Hi Brent,

    From your description I could understand the root cause.

    You are trying to apply the old First Time Config algorithm whereas the new Smart Config algorithm is implemented.

    Prior to V1.10, First Time Config was used (with the Probe/beacon method you were describing).

    V1.10 and above are using Smart Config and the iPhone/Android/PC use different application to implement it.

    The First Time Config is still there for legacy users but it is not supported from V1.10 and later.

    The iPhone/Android/PC applications can be found here: http://processors.wiki.ti.com/index.php/CC3000_Wi-Fi_Downloads#CC3000_SmartConfig.

    Just look for the table with the label: "CC3000 SmartConfig & Home Automation".

     

    Regards,

    Shlomi

  • Hi Brent,

    the debug output comes from pin 2 and 4 of the CC3000MOD. I still can't understand why TI created the following page:

    http://processors.wiki.ti.com/index.php/CC3000_Logger

    and have not added at which pins the output is coming out. See also my remarks from May 2013 at bottom of the page.

    (TI makes great products, thanks for this, but certain topics make you cry...)

    Pay attention that level of these pins is 1,8V. It work with a FTDI cable named TTL-232RG-VREG1V8-WE (only direction CC3000MOD -> PC is used).

    Please check my info before using it, all personal experience (no info by TI, nor checked for errors by me) and all mentioned could be wrong.

    Best regards,

    Martin

  • Hi Martin,

    Thank you so much for your post.  That makes me feel so much better.  I thought I was the only one that could not understand the documentation.  It appears that I am out of sync with regards to my host driver and application code - despite my best efforts to keep them in sync from following what documentation I could.  I was also wondering if I was totally in left field with regards to the logger, because it didn't make any sense to me, either.  Thanks for your explanation.  I do you have one question.  You mentioned checking your info before using the FTDI cable but you didn't mention where your info is.  Do you mean just this post or do you have another post that I should reference?

    Thanks,

    Brent

  • Some more hints:

    - Look at the following page for some more details regarding debug cable:

    http://processors.wiki.ti.com/index.php/CC3000_Radio_Tool

    Some documentation mentions the debug pins, some not (marking them as reserved), but often the pins are available. Perhaps they used it for internal debugging, and later also open them for usage by costumers, but documentation was not yet updated to reflect this.

    - You cannot decode the logfiles by yourself, you must post them and TI support can analyze them and give hints.

    - As far as i know there is no description of the SPI data, which makes it more complicated to debug information flow between host and CC3000.

  • And perhaps this page:

    http://processors.wiki.ti.com/index.php/CC3000_Flashing_Guide

    where you can see the FILE IDs (and length and content of blocks), which can be used with nvmem_read.

  • Hi Shlomi,

    That appears to be part of the problem.  It would be nice if the documentation was clearer with regards to the smart config.  I had followed the smart config link to get to the first time config and thought they were the same thing.

    So, I tried your suggestion and followed the new link to the real smart config procedure.  I am getting it partially to work.  If I use an iOS device, I am able to get the return from the start smart config command as I would expect.  If I use the Java App on a windows 7 PC, it does not work.  (I tried two different windows PCs, just to be sure.)  Is there something special that needs to be done with the Java App?

    Also, there is a mistake on the Smart Config page under the Procedure heading in the Smart Config flow - AES encryption disabled section.  The nvmem_create_entry and aes_write_key calls should not be there.  (The next section - APIs - has it correct but the two are inconsistent and a little misleading.

    Thanks,

    Brent

  • Hi Shlomi,

    In addition to the problem with the Java App I mentioned earlier, I am back to my original problem.  It appears that the profile is not getting created correctly.  I have tried to leverage code from some of the sample apps on the CC3000 website but I am not sure if they are working correctly.  Is there a sample of a smart config program that you could point me to that you would trust?  I am looking for both encrypted and non-encrypted methods.

    What I am observing is the when I try to use the encrypted method, the data stored in the common EEPROM space is unencrypted and when it is read and decrypted, it is becoming corrupted.  When I try to run with encryption, the data is not read from the EEPROM space to create a profile.

    I am still using 1.10.2 because I was in the middle of getting the patch programming code to work when I got your post this morning and reverted back to 1.10.2 to keep consistency.  If you feel it would be better to move to 1.11, I could do that and then continue working on this problem.  What do you think?

    Thanks,

    Brent

  • Brent,

    Regarding the Java applet, is it working on the iPhone with the same AP? If so, can you tell whether your AP is 11a capable? IS it MIMO enabled? In other wards, can you tell whether the PC connects to the AP using either 11a or MIMO?

    Regrading Smart Config, there is no difference between 1.10.2 and 1.11 but please note that the host driver is different so the patches must be aligned with the host driver. E.g. if you downloaded the last host driver for 1.11 and working with 1.10.2, then you must revert the host driver back.

    I suggest using the Basic WiFi Application for Smart Config testing. Please note that by default Smart Config is using encryption. You can see it by the following define in the code, CC3000_UNENCRYPTED_SMART_CONFIG. Since it is not defined by default, it is the encrypted version. Also, the CC3000 and the application must be aligned in terms of using encryption or not. There is a check box for it. If you check it for encryption, then you mustn't define CC3000_UNENCRYPTED_SMART_CONFIG. If you uncheck this box, please define CC3000_UNENCRYPTED_SMART_CONFIG. Lastly, please do not confuse encryption and password fields in the application. Password is for the AP password if it is not an open AP. Encryption is in order to encrypt the AP password as part of Smart Config process.

    Another thing, when the process is not encrypted, the profile is created withing CC3000 and the event indicates the process is finished and a profile exists (no need to do any post processing in the host). In the encrypted version, there is post processing that needs to be done (under the CC3000_UNENCRYPTED_SMART_CONFIG define).

    Regards,

    Shlomi

  • Hi Shlomi,

    I did make some progress today.  I was able to get to the point where I started smart config, successfully download a profile (using encryption) and then have it connect using that profile to the LAN sufficiently enough for the device to be pinged.  The main point I missed was clicking the box by the key to enable the encryption on the app.  Thank you for your help above in getting to this point.  There are still a few areas that I need help with.

    1.  I am still having problems getting the app to work on windows machines.  It is version 1.1.  I have been able to get it to work with 3 iOS devices - 2 iphones and an ipad.  Both phones are 802.11n capable and the AP is running with 802.11n.  I am not sure if the AP is 11a capable, but I believe it is implied.  All devices are using the same AP.  (We do have another AP that is running with 802.11g and I get the same results from it.)  My PC is 802.11n capable.  I tried it with it both enabled and disabled; with the same results.  I don't believe MIMO is enabled - especially when I disabled 802.11n.  Since we have two different wireless networks, I have taken care to make sure that everything is consistent and pointing to only one network at a time and not part pointing to one and part point to the other.   Do you have other suggestions?

    2.  After the smart config event is successful, the button on the app is remaining red.  I expect that it should return back to the green state.  Can you help explain why?  I will put my code below in hopes that you may be able to determine what I am missing.

      // Start CC3000 State Machine
      resetCC3000StateMachine();
        // Initialize Board and CC3000
      initDriver(0);                          
        // Reset all the previous configuration
      wlan_ioctl_set_connection_policy(DISABLE, DISABLE, DISABLE);   
      wlan_ioctl_del_profile(255);
      //Wait until CC3000 is dissconected
      while (ulCC3000Connected == 1)
      {
        __delay_cycles(100);
        hci_unsolicited_event_handler();
      }
      // Trigger the Smart Config process
      wlan_smart_config_set_prefix(aucCC3000_prefix);
      #ifndef CC3000_UNENCRYPTED_SMART_CONFIG
      // Start the Smart config process with AES enabled
      wlan_smart_config_start(1);
      #else
      // Start the Smart config process with AES disabled
      wlan_smart_config_start(0);
      #endif
       // Wait for Smart config finished
      while (ulSmartConfigFinished == 0)
      #ifndef CC3000_UNENCRYPTED_SMART_CONFIG
      // create new entry for AES encryption key
      nvmem_create_entry(NVMEM_AES128_KEY_FILEID,16);
      // write AES key to NVMEM
      aes_write_key((unsigned char *)(&smartconfigkey[0]));
      // Decrypt configuration information and add profile
      wlan_smart_config_process();
      #endif

      // configure to connect automatically to the AP
      // retrieved in the Smart Config process
      wlan_ioctl_set_connection_policy(DISABLE, DISABLE, ENABLE);
      // reset the CC3000
      wlan_stop();
      __delay_cycles(600000);
      wlan_start(0);
      ConnectUsingSmartConfig = 1;
      // Mask out all non-required events
      wlan_set_event_mask(HCI_EVNT_WLAN_KEEPALIVE|HCI_EVNT_WLAN_UNSOL_INIT|
                          HCI_EVNT_WLAN_ASYNC_PING_REPORT);
      mdnsAdvertiser(1, DevServname, sizeof(DevServname));
      mdnsAdvertiser(1, DevServname, sizeof(DevServname));
      mdnsAdvertiser(1, DevServname, sizeof(DevServname));

    Thanks,

    Brent

  • Brent,

    1. The only two possible causes I have seen before is when the PC uses MINO or doing an 11a. If you are capable of sniffing the air, this will conclude whether the device is transmitting the Smart Config data.
    2. The button should return to green when it gets an mDNS response with matching device name. You need to align the device name you configure as part of mdnsAdvertiser() API and the one you type on the iPhone application. In addition, please try to transmit more mdns packets spaced in time and not back to back as in the example you sent (since iPhone may miss these packets if it is not listenning at the same moment).

    Shlomi