CC3000 SmartConfig

Overview

      A first step in utilizing CC3000 in a Wi-Fi enabled application is to configure CC3000 to a user’s Wi-Fi network. This requires information on the AP, or SSID name, and the security passcode when WEP/WPA/WPA2 is enabled. Considering that embedded Wi-Fi applications will generally lack user interfaces such as keypads or touchscreens, this process can be complex without the use of advanced I/O.

 

     To create a great user experience, TI has created SmartConfig™ technology - a one-step and one-time process to connect a CC3000-enabled device to the home wireless network. This greatly stands apart from other Wi-Fi suppliers who require multiple steps to configure a device onto the network.

 

     Smart Config leverages the standard mechanisms present in Wi-Fi to configure a CC3000's association information on the fly, regardless of whether user-interface is available. In this process a Wi-Fi enabled device such as a smartphone, tablet or a laptop is used to send the association information to the CC3000.

 

      Addtionally, SmartConfig does not depend on the host microcontroller's I/O capabilities, thereby usable by deeply embedded applications. It can be used to associate multiple devices to the same AP simultaneously. The Configuration process is secured with AES-128 encryption, and the SSID and KEY length are supported up to 32 bytes.

      And furthermore, the device used to configure (smartphone, tablet, or PC) stays connected to the user’s home network during the configuration process (as opposed to other methods that require disconnection).

 


Refer to getting started with Smartconfig link, in order to see how to run the smartconfig aplicaiton on smartphones.

 

Procedure

      In order to perform the Smart Config procedure, CC3000 must initially enter the Smart config mode. This process can be triggered externally on the CC3000 device by pressing a button on the processor's board.

      For example, it will be S1 on the MSP430 Experimenter board. For more details on this, please refer to Using Smart Config section in the CC3000 First Time Getting Started Guide.

      When the configuration process is triggered, the CC3000 device performs the following:

 

  •  CC3000 enters the Smart Config state and starts probing UDP packets which contain the information regarding the SSID and the key of the AP that the CC3000 will connect to..
  •  Once CC3000 receives all the association information, it generates a SIMPLE_CONFIG_DONE asynchronous event to the host and saves the Smart Config association information received in shared memory (EEPROM file ID 13)
  •  The Smart Config process can be performed with AES encryption or without, decided by an environment compilation flag (CC3000_UNENCRYPTED_SMART_CONFIG)
  •  If AES encryption is selected, the configuring device (smartphone) will encrypt the association information broadcast with a specific key chosen by both sides.
  •  If AES encryption is selected, the host first decrypt the association information from the shared memory and then stores it as a profile.
  •  If AES encryption is not selected, CC3000 stores the association information as a profile.
  •  Once the Smart Config process is complete, the profile is stored, CC3000 resets and connects to the desired AP, and an mDNS packet is sent to the configuring device in order to stop the configuration process and to announce completion
  •  The following figures shows this process with and without AES encryption enabled as seen by the host MCU and CC3000:

Smart Config flow - AES encryption enabled


Smart Config flow - AES encryption disabled


 

Important Note:

      During the smartconfig process, there is a momentary insecurity when working in "AES encryption disabled" mode, as the SSID and password are sent unencrypted during that time. This step is typically performed once in a product's lifetime. The advantage of working in "AES encryption disabled" mode is the ability to configure simultaneously multiple devices without the need to sync the key among all of them. It also gives a better user experience in some product deployments.

     For security, users/customers should use the "AES encryption enabled" mode (assuming memory is not an issue). This requires customers to ship a unique AES key with each device shipped (e.g. printed on a sticker on the side of the device).

APIs

The APIs used to complete the Smart Config process are as follows:

nvmem_create_entry(NVMEM_AES128_KEY_FILEID, AES128_KEY_SIZE) – Create an entry at field ID 12 to store the AES key. (Only when AES encryption is enabled)

aes_write_key(key)- write the key to EEPROM - fileID 12. (Only when AES encryption is enabled)

wlan_smart_config_set_prefix(aucCC3000_prefix)– Set CC3000 prefix. Currently this API has to be called with the value ‘TTT’.

wlan_smart_config_start() – Send command to CC3000 to start the Smart config process.

wlan_smart_config_process(1) – Call this API with value 1 when AES encryption is enabled, otherwise 0. Brief process the acquired data and store it as a profile.

wlan_ioctl_set_connection_policy(DISABLE, DISABLE, ENABLE)– sets the connection policy, Set parameters to use Auto connect in order to connect to a stored profile.

 

 

Limitations

  •  Currently is it not possible to configure multiple CC3000 devices to different APs simultaneously

     NOTE: It is possible to configure multiple CC3000 devices to different APs serially, OR configure multiple CC3000 devices to the same AP simultaneously

  •  Currently it is only possible to use smartphones and tablets as the configuring device, including IOS and Android devices. In the future, a PC application can be used as well. 
  •  Key length is limited to 31 characters only when working with AES encryption.
  •  Smart Config - ascii WEP security without SmartConfig AES encryption doesn't work. (WEP security with Smart Config AES encryption does work, same configuration is working with wlan_connect)
  •  MTU in the configurable side should be set to 1500.

Examples using IOSAndroidPC devices

The following section shows how to set the IOS application to configure CC3000 to connect to a specific AP. Before you begin, it is important to ensure that CC3000 is in Smart Config mode and the configuring device is connected to the same network that you want the CC3000 to connect to.


 

  •  SSID: AP’s SSID is automatically detected or can be configured by the user.
  •  Password: AP’s password in the case where WEP, WPA, WPA2 security is used. When security is OPEN, leave this field empty.
  •  Gateway IP Address: AP’s IP is automatically detected.
  •  Key: Fill in this field only case when AES is enabled. Make sure the key is identical to the key on the embedded side. Key length: 16 characters.
  •  Device Name: In order to stop the configuration process (once CC3000 is associated to the AP) an mDNS packet is sent with the device name. Make sure the device name is identical to the device name on the embedded side.
  •  Start: Press this key to start the configuration process. At this point this button will turn to STOP and will be colored red. Once CC3000 is connected and the configuring device receives the mDNS packet with the device name, this button will turn blue again.

Application Development Information

TI provides Smart Config example application for IOS, Android and PC devices.

This application is the configuring side in the process of connecting CC3000 device to a specific AP using the Smart Config feature.

In order to develop similar application for your product, please use the following wiki pages:

Smart Config Application development information - iOS

Smart Config Application development information - Android

Smart Config Application development information - PC

原文地址:https://www.cnblogs.com/NL34/p/3538294.html