Jump to content
Sign in to follow this  
Marc

Using Smartconfig

Recommended Posts

Hi there,

 

I am trying to use the WiFi.startSmartConfig() feature for the CC3000 booster pack on a TIVA C launchpad, but I can't seem to get it to work with energia (works fine with TI examples on code composer). I'm using smartconfigAES16 as the key and home_assistant as the device name, is there an example of how to use smartConfig with energia? I currently have it running in the setup() function, but it seems to get caught within the WiFi.startSmartConfig() function. I'm using the java applet http://www.ti.com/ww/en/wifi/smartConfig/ for the smartconfig.

 

Thank you in advance!

Share this post


Link to post
Share on other sites

Confirmed that this is a bug. All works fine on the MSP430F5529 LaunchPad but TivaC/Stellaris LP exhibits a hang. Not sure yet what the cause is but could be due to buffer under run if I have to guess. Will look into it but it might be a couple weeks before I have a fix. Let us know if you turn up more information in the meantime.

Share this post


Link to post
Share on other sites

Maybe a bug in the latest version 1.11 it worked for me in the past but i am not able to associate it anymore after patching ti 1.11. Works if you call api wlan_connect inside your code with the correct parameters.

Also not all AP seem to work, i was not able to associate wuth Netgear dgn2000 but works fine with dlink.

In my opinion smartconfig causes more problems than the ones it trues to resolve.

 

 

 

Sent from my Sony Tablet Z

 

 

Share this post


Link to post
Share on other sites

Thanks for the responses! Yes...I know what you mean, I noticed it works better on the newer routers but has issues with older (~3yrs) ones. Also, it seems to work with the iphone app but doesn't work with the java applet anymore (when testing using CCS with latest firmware). It's still a nice feature, when it works.

Share this post


Link to post
Share on other sites

A few days ago i changed something in my WiFi Setup and noticed that the cc3000 couldnt connect to my WiFi anymore and hang in Wifi.begin(). I found out that i accidently changed my WiFi to IEEE 802.11 n and the CC3000 only supports IEEE 802.11 b/g. After changing my router back to mixed g/n mode everything worked as intended.

I suspect that this could be the reason why the WiFi.startSmartConfig() hangs on some network configurations.

Share this post


Link to post
Share on other sites

The holdup seems to be in this segment of the code within startsmartconfig line 516:

        // Wait for Smartconfig process complete
        while (ulSmartConfigFinished == 0)
        {
                delay(500);
        }
 
Temporarily I replaced this with a 20 second delay and it seems to work.

Share this post


Link to post
Share on other sites

Yes, temporarily I created a new smartconfig function in my application with the 20 second delay that seemed to do the trick. This is the code:

 

 

void startsmartconfig(){
        int ulSmartConfigFinished = 0;
        int ulCC3000Connected = 0;
        int ulCC3000DHCP = 0;
        int OkToDoShutDown=0;
        const char aucCC3000_prefix[] = {'T', 'T', 'T'};
const unsigned char smartconfigkey[] = {0x73,0x6d,0x61,0x72,0x74,0x63,0x6f,0x6e,0x66,0x69,0x67,0x41,0x45,0x53,0x31,0x36};


        // Reset all the previous configuration
        wlan_ioctl_set_connection_policy(0, 0, 0);        
        wlan_ioctl_del_profile(255);
        
        //Wait until CC3000 is disconnected
        while (ulCC3000Connected == 1)
        {
                delay(500);;
        }
        
        // Trigger the Smart Config process


        wlan_smart_config_set_prefix((char*)aucCC3000_prefix);


        
        // Start the SmartConfig start process
        wlan_smart_config_start(1);
                                                                           
        // Wait for Smartconfig process complete


        delay(20000);
#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(0, 0, 1);


        // reset the CC3000
        wlan_stop();
        delay(1000);




        
}

Share this post


Link to post
Share on other sites

Hello, =)

 

I just bought the CC3000, together with the Tiva C Series Launchpad. I follow the guide line:

 

1. I downloaded the Patch Programmer for Stellaris LP - LM4F120H5QR, because it does not have Patch Programmer for TM4C123GH6PM.. What I see is only TM4C123GH6PGE.. Is this true? Also, I downloaded the LM flash programmer to load the .bin file to the TIva. 

 

2. Then I downloaded the SDK 1.11 (Windows) and "import the existing ccs eclipse project" for Basic Wifi Application to the CCS. But when I built the files for project "cc3000 spi", there is an error.. -- > gmake: *** No rule to make target `C:/ti/CC3000SDK/CC3000 SDK/LM4F120H5QR/Basic WiFi Application/Patch Programmer/Source/cc3000_spi/src/spi.c', needed by `spi.obj'.

 

Did I do something wrong? I need to debug the chip with Basic Wifi Application sample project file before I can perform the Smart Config right?

 

So after I load the Patch Programmer (Stellaris LP - LM4F120H5QR), the LED blink the red led and finally turns to a constant blue. But after that, what should I do?

Sorry if I ask stupid question but I am totally loss...

 

Warmest Regards ever,

newbiee

 

 

(Reference: http://processors.wiki.ti.com/index.php/CC3000_Wi-Fi_Downloads )

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×