Close
0%
0%

Internet-of-things with CC3200 Dev Board

Internet-of-things with CC3200 development board or my new wireless Thingamajiggy.

Similar projects worth following
The goal of the project is to develop an IoT system with CC3200MOD or CC3200 development board. Created for the Internet of Things (IoT), the SimpleLink CC3200 Internet-on-a-chip solution is a wireless MCU that integrates a high-performance ARM Cortex-M4 MCU allowing the development of entire application with a single IC.

The goal of the project is to develop an IoT system with CC3200MOD or CC3200 development board. Created for the Internet of Things (IoT), the SimpleLink CC3200 Internet-on-a-chip solution is a wireless MCU that integrates a high-performance ARM Cortex-M4 MCU allowing the development of entire application with a single IC.

The following video is a basic demo of CC3200 as a HTTP server.

What I am planning on doing at this point is to make modifications to the original code to monitor and control electronic devices that will be attached to the board. I am planning on adding analog interface. This chip can run HTTP server which makes it possible to run cloud applications. I will be updating my design files as I go. At this point it is not much of a project. The example I am currently running can be found at:

Exosite

In this example CC3200 runs Exosite website, it allows remotely see data, interact with devices, and build dashboards / alerts. The Exosite free account in the ti.exosite.com domain is provided by TI and Exosite for evaluation purposes. There are no time limits, you can choose to use it as long as you want (quote from the above webpage). The following 3 images show my phone connected to the dev board with CC3200 WiFi as an Access Point. CC3200 is in server mode and it runs mysimplelink.net webpage.

The following 2 images show RED LED On and Off with the web page switch.

RED LED is OFF

RED LED is ON

All the magic of switching ON and OFF the RED LED happens inside the SL_NETAPP_HTTPPOSTTOKENVALUE_EVENT server event. This event is part of

void SimpleLinkHttpServerCallback( *pSlHttpServerEvent, *pSlHttpServerResponse){

...

}

function.

case SL_NETAPP_HTTPPOSTTOKENVALUE_EVENT:
        {
            unsigned char led;
            unsigned char *ptr = pSlHttpServerEvent->EventData.httpPostData.token_name.data;

            //g_ucLEDStatus = 0;
            if(memcmp(ptr, POST_token, strlen((const char *)POST_token)) == 0)
            {
                ptr = pSlHttpServerEvent->EventData.httpPostData.token_value.data;
                if(memcmp(ptr, "LED", 3) != 0)
                    break;
                ptr += 3;
                led = *ptr;
                ptr += 2;
                if(led == '1')
                {
                    if(memcmp(ptr, "ON", 2) == 0)
                    {
                        GPIO_IF_LedOn(MCU_RED_LED_GPIO);
                        g_ucLEDStatus = LED_ON;

                    }
                    else if(memcmp(ptr, "Blink", 5) == 0)
                    {
                        GPIO_IF_LedOn(MCU_RED_LED_GPIO);
                        g_ucLEDStatus = LED_BLINK;
                    }
                    else
                    {
                        GPIO_IF_LedOff(MCU_RED_LED_GPIO);
                        g_ucLEDStatus = LED_OFF;
                    }
                }
                else if(led == '2')
                {
                    if(memcmp(ptr, "ON", 2) == 0)
                    {
                        GPIO_IF_LedOn(MCU_ORANGE_LED_GPIO);
                    }
                    else if(memcmp(ptr, "Blink", 5) == 0)
                    {
                        GPIO_IF_LedOn(MCU_ORANGE_LED_GPIO);
                        g_ucLEDStatus = 1;
                    }
                    else
                    {
                        GPIO_IF_LedOff(MCU_ORANGE_LED_GPIO);
                    }
                }

            }
        }
            break;

Web page “demos-sprinkler.html” and “page-actions.js” invoke the “$.post” method: $.post("No_content", {"__SL_P_ULD": params});

The “$.post” method controls the onboard RED LED. The following are two code excerpts from “demos-sprinkler.html” and “page-actions.js”

//demos-sprinkler.html
if (switchBtn.hasClass('on')) {
    switchBtn.removeClass('on');
    com.TI.toggleLED('_OFF');		// Turn off the LED			
    spriklerRunning = false;
    sprinkler.attr('src',"images/demo-sprinkler-off.jpg");	
    imageOn = false;
} else {
    switchBtn.addClass('on');
    com.TI.toggleLED('_Blink');		// Turn LED ON		
    spriklerRunning = true;
    imageOn = true;
}

// page-actions.js
com.TI.toggleLED = function(whichOne) {

var LEDnum = "1",

params = "LED"+LEDnum;

params += whichOne;

$.post("No_content", {"__SL_P_ULD": params});

};

Web page “demos-sprinkler.html” calls com.TI.toggleLED('_Blink'); function from “page-actions.js”, which enacts $.post("No_content", {"__SL_P_ULD": params}) method.

This $.post method enables RED LED turn on case

else if(memcmp(ptr, "Blink", 5) == 0)
{
     GPIO_IF_LedOn(MCU_RED_LED_GPIO);		// Turn On LED
     g_ucLEDStatus = LED_BLINK;
}
else
{
     GPIO_IF_LedOff(MCU_RED_LED_GPIO);
     g_ucLEDStatus = LED_OFF;
}

in the

void SimpleLinkHttpServerCallback(SlHttpServerEvent_t *pSlHttpServerEvent,...
Read more »

CC3200-LAUNCHXL_sch.pdf

CC3200 Dev Board Schematics

Adobe Portable Document Format - 134.95 kB - 03/19/2016 at 02:14

Preview Download

  • 1 × SimpleLink Wi-Fi CC3200 LaunchPad

  • Working on a mobile website for the CC3200 board

    Roman11/26/2016 at 21:02 0 comments

    I am currently working on a mobile web page for the CC3200 interface. You can find all the updated files on my Github. One of the web pages I am currently working on is demos-sprinkler.html. You will find it in my updated files on the Github. The page will adjust to the screen size.


  • UART via WiFi, send messages to a webpage

    Roman06/19/2016 at 14:27 0 comments

    Currently there are tree tockens defined in param_demos.html:

    =__SL_G_UTP

    =__SL_G_UAC

    =__SL_G_ULD

    The tockens are defined in the main.c function:

    //*****************************************************************************
    //                 GLOBAL VARIABLES -- Start
    //*****************************************************************************
    static const char pcDigits[] = "0123456789";
    static unsigned char POST_token[] = "__SL_P_ULD";
    static unsigned char GET_token_TEMP[]  = "__SL_G_UTP";
    static unsigned char GET_token_ACC[]  = "__SL_G_UAC";
    static unsigned char GET_token_UIC[]  = "__SL_G_UIC";
    static unsigned char GET_token_URT[]  = "__SL_G_URT";

    I have added __SL_G_URT token to the definition list above. I will be using it for

    UART communications.

    $(function() {
        var Device_Temperature = $('#Device_Temperature_out'),
            Device_Accelerometer = $('#Device_Accelerometer_out'),
            demoPolling = new com.TI.tokenPoller({
                "paramPage": <a href="#param"><font size="3" color="blue">"param_demos.html",</a></font> 
                "refreshRate": 200,
                "valueMap": [{
                "paramId": "Device_Temperature",
                    "outputSuccess": function(output) {
    		// Print temperature data. id="Device_Temperature" __SL_G_UTP tocken is received
                        Device_Temperature.html(output);
                    },
                    "outputDefault": function() {
                        Device_Temperature.html("<i>reloading</i>");
                    }
                },
                {
                "paramId": "Device_Accelerometer",
                    "outputSuccess": function(output) {
                    	// Print accelerometer data. Device_Accelerometer is the token received
                        Device_Accelerometer.html(output);
                    },
                    "outputDefault": function() {
                        Device_Accelerometer.html("<i>reloading</i>");
                    }
                }]
            });
    });

    I have added the new GET_token_URT token to the definition list:

    static unsigned char GET_token_URT[] = "__SL_G_URT";

    Below is shown new token reader I am using for UART communications.

    /*
    * New UART token *************************************************************************
    */
    if(memcmp(pSlHttpServerEvent->EventData.httpTokenName.data,
    	GET_token_URT, strlen((const char *)GET_token_URT)) == 0)
    	{
    
    		UART_PRINT("\n\r\rExecuting UptimeTask Enter a string and press enter\n\r\r");
    		
    		//g_UartHaveCmd=GETChar(&g_ucUARTRecvBuffer[0]);
    		//g_ucUARTRecvBuffer[0] = 'H';
    		//uart = g_ucUARTRecvBuffer;
    		//uart = "hello uart";
    		//short sLenuart = itoa(g_accXIntervalSum,(char*)uart);	
    			
    		//Get length of the sring stored in g_ucUARTRecvBuffer
    		strcpy((char*)pSlHttpServerResponse->ResponseData.token_value.data,"hello uart");
    		pSlHttpServerResponse->ResponseData.token_value.len += strlen("hello uart");
    		//Pointer to the entered string
    		//pSlHttpServerResponse->ResponseData.token_value.data = uart;
    		//pSlHttpServerResponse->ResponseData.token_value.len += sLenuart;
    	}
    }
    The updated list of tockes in param_demos.html looks as follows now:

    demos-appliances.html has a new "paramId" for reading data from UART tocken:
    
    {
    	"paramId": "UART",
    	"outputSuccess": function(output) {
    		// Print accelerometer data. Device_Accelerometer is the token received
    		Device_UART.html(output);
    	},
    	"outputDefault": function() {
    		Device_UART.html("<i>Reading UART data</i>");
    	}
    }]

    To get ready to send strings of variable lengths I have done a couple of changes to the GET_token_URT. First I have declared unsigned char *uart in the SL_NETAPP_HTTPGE TTOKENVALUE_EVENT

    switch (pSlHttpServerEvent->Event)
        {
            case SL_NETAPP_HTTPGETTOKENVALUE_EVENT:     // Get data from the server
            {
                unsigned char *ptr;
                unsigned char *ptraccX;
                unsigned char *ptraccY;
                unsigned char *ptraccZ;
                unsigned char *uart;
                ...
            }
            ...
        }
    

    And the new UART tocken looks like this now:

    /*
    * New UART token ****************************New UART token*********************************** New UART token
    */
    if(memcmp(pSlHttpServerEvent->EventData.httpTokenName.data,
    GET_token_URT, strlen((const char *)GET_token_URT)) == 0)
    {
    	uart = "Sending srings of data";                
    	strcpy((char*)pSlHttpServerResponse->ResponseData.token_value.data, (const char *) uart);
    	pSlHttpServerResponse->ResponseData.token_value.len += strlen((const char *) uart);
    } 
    

    I...

    Read more »

  • Reading Serial Data in UptimeTask

    Roman06/10/2016 at 15:46 0 comments

      Function main has a couple of main threads:

      1. ExositeTask
      2. UptimeTask
      3. AccSampleTask

      I have changed task priorities for UptimeTask and AccSampleTask. UptimeTask has now a higher priority. I decided to use UptimeTask to read my UART port:

      static void UptimeTask( void *pvParameters )
      {
      	char c = 0;
      	while(1)
      	{
      		//GPIO_IF_LedOff(MCU_ORANGE_LED_GPIO);
      		//GPIO_IF_LedOff(MCU_GREEN_LED_GPIO);
      		g_uptimeSec++;
      		c = MAP_UARTCharGetNonBlocking(CONSOLE);        // Get a single character
      		if (c != 0){
      			UART_PRINT("\n\r\rExecuting UptimeTask Enter a string and press enter\n\r\r");
      			g_UartHaveCmd=GETChar(&g_ucUARTRecvBuffer[0]);
      		}
      //....A bunch of commented out junk
      osi_Sleep(1000);
      }

      See updated files on the Github. What I am hoping to achieve is to connect serial port of the CC3200 to my #Multimeter + Multimeter+ serial expansion port and start transmitting data through the WiFi. It might take some time though.

  • Blinky LEDs with CC3200 Exosite

    Roman04/09/2016 at 13:30 0 comments

    I just updated my source code to drive two additional LEDs.

    LEDs are connected to PIN 18 and PIN 15 as shown on the diagram above.

    Below is the code exerpt to blink LEDs 50 times.

    if(led == '1')
    {
        if(memcmp(ptr, "ON", 2) == 0)
        {
             GPIO_IF_LedOn(MCU_RED_LED_GPIO);
             g_ucLEDStatus = LED_ON;
    
        }
        else if(memcmp(ptr, "Blink", 5) == 0)
        {
            for (i = 0; i < 50; i++){
            GPIO_IF_LedOn(MCU_RED_LED_GPIO);// Turn On LED
            MAP_UtilsDelay(delay);
            GPIO_IF_LedOff(MCU_RED_LED_GPIO);// Turn Off LED
            MAP_GPIOPinWrite(GPIOA3_BASE,0x10,0x10);
            MAP_UtilsDelay(delay);
            MAP_GPIOPinWrite(GPIOA2_BASE,0x40,0x40);
            MAP_UtilsDelay(delay);
            MAP_GPIOPinWrite(GPIOA3_BASE,0x10,0);
            MAP_UtilsDelay(delay);
            MAP_GPIOPinWrite(GPIOA2_BASE,0x40,0);
            MAP_UtilsDelay(delay);
         }
         GPIO_IF_LedOn(MCU_RED_LED_GPIO);// Turn On LED
         MAP_GPIOPinWrite(GPIOA2_BASE,0x40,0x40);
         MAP_GPIOPinWrite(GPIOA3_BASE,0x10,0);
         g_ucLEDStatus = LED_BLINK;
    
         }
         else
         {
          GPIO_IF_LedOff(MCU_RED_LED_GPIO);
          MAP_GPIOPinWrite(GPIOA3_BASE,0x10,0);
          MAP_GPIOPinWrite(GPIOA2_BASE,0x40,0);
          g_ucLEDStatus = LED_OFF;
          }
    }

    Blinking LEDs are fun :).

  • Analog Front for CC3200 ADC

    Roman03/29/2016 at 20:00 0 comments

    I am planning on adding analog front circuit to CC3200 ADC pin 59. Shown above is my preliminary circuit diagram. The design file can be downloaded here. I will be posting updates to the schematics.

  • Updates on Exosite and source code

    Roman03/28/2016 at 20:41 0 comments

    I made a couple of changes to the Exosite and the source code. All updates can be downloaded from CC3200 Site and Source code link. My goal is to get numerical data from the accelerometer and display it on the website. So, I have added couple lines of code to the HTTP server callback function. Now the function sends numeric values x-axis to the Exosite.

    void SimpleLinkHttpServerCallback(SlHttpServerEvent_t *pSlHttpServerEvent, 
                                    SlHttpServerResponse_t *pSlHttpServerResponse){
    unsigned char *ptraccX;
    …
        ReadAccSensor(); //float *pfCurrTemp
        ptraccX = pSlHttpServerResponse->ResponseData.token_value.data;
        //ptraccY = pSlHttpServerResponse->ResponseData.token_value.data;
        //signed char cAccXT2;
        //signed char cAccYT2;
        //signed char cAccZT2;
        //BMA222ReadNew(&cAccXT2, &cAccYT2, &cAccZT2);
        //volatile static float g_accXIntervalSum = 0;
        //volatile static float g_accYIntervalSum = 0;
        //volatile static float g_accZIntervalSum = 0;
        //char AccX = (char)cAccXT2;		
        //char AccY = (char)cAccYT2;		
        short sTempLenAccX = itoa(g_accXIntervalSum,(char*)ptraccX);// Convert integer to ASCII in decimal base. Convert x-axis value to a decimal string.
        ptraccX[sTempLenAccX++] 	= ' ';
        ptraccX[sTempLenAccX] 	= ' ';
    
    
        //short sTempLenAccY = itoa(g_accYIntervalSum,(char*)ptraccY);// Convert integer to ASCII in decimal base. Convert x-axis value to a decimal string.
        //ptracc[sTempLenAccY++] 	= ' ';
        //ptracc[sTempLenAccY] 	= ' ';
    
        if(g_ucDryerRunning)	    // g_ucDryerRunning is set in void ReadAccSensor()
         {
           //strcpy((char*)pSlHttpServerResponse->ResponseData.token_value.data,"Running");
           //pSlHttpServerResponse->ResponseData.token_value.len += strlen("Running");
           pSlHttpServerResponse->ResponseData.token_value.data = ptraccX;              
           pSlHttpServerResponse->ResponseData.token_value.len += sTempLenAccX;
           //pSlHttpServerResponse->ResponseData.token_value.data = ptraccY;
           //pSlHttpServerResponse->ResponseData.token_value.len += sTempLenAccY;
          }
    }
    

    Now I can read x-axis value of the accelerometer. Next step is to get data from Y and Z axis.

    After a few hours of hard work and I have managed to send and display data from the other two axis (Y and Z).

    BMA222ReadNew function returns the accelerometer readings. The return values are signed char types. I cast them as unsigned char type, I think that is the reason why I get weird readings sometimes.

    BMA222ReadNew(&cAccXT1, &cAccYT1, &cAccZT1);

    After that I convert HEX data to character string using the itoa () function.

    Using brute force I send data and labels from SimpleLinkHttpServerCallback function:

    ReadAccSensor(); //float *pfCurrTemp
                	ptraccX = pSlHttpServerResponse->ResponseData.token_value.data;
    signed char cAccXT1, cAccYT1, cAccZT1;
                	//unsigned char cAccXTu, cAccYTu, cAccZTu;
                	unsigned char cAccYTu, cAccZTu;
                	//_u8   *cAccXT2;	//_u8     *data;
                	_u8     *cAccYT2;
                	_u8     *cAccZT2;	//_u8     *data;
    
                	BMA222ReadNew(&cAccXT1, &cAccYT1, &cAccZT1);
    
                	//cAccXTu = (unsigned char) cAccXT1;
                	cAccYTu = (unsigned char) cAccYT1;
                	cAccZTu = (unsigned char) cAccZT1;
    
                	//cAccXT2 = &cAccXTu;
                	cAccYT2 = &cAccYTu;
                	cAccZT2 = &cAccZTu;
    
                	//ptraccX = cAccXT2;
                	ptraccY = cAccYT2;
                	ptraccZ = cAccZT2;
    
    short sLenAccX = itoa(g_accXIntervalSum,(char*)ptraccX);// Convert integer to ASCII in decimal base. Convert x-axis value to a decimal string.
    short sLenAccY = itoa(g_accYIntervalSum,(char*)ptraccY);// String that contains Y-axis data
                    ptraccY[sLenAccY++] = ' ';
    short sLenAccZ = itoa(g_accZIntervalSum,(char*)ptraccZ);// String that contains Z-axis data
                    ptraccY[sLenAccZ++] = ' ';
    
                    ptraccX[sLenAccX++] = ' ';
                    ptraccX[sLenAccX++] = ' ';
                    ptraccX[sLenAccX++] = 'X';
                    ptraccX[sLenAccX++] = '-';
                    ptraccX[sLenAccX++] = 'a';
                    ptraccX[sLenAccX++] = 'x';
                    ptraccX[sLenAccX++] = 'e';
                    ptraccX[sLenAccX++] = 's';
                    ptraccX[sLenAccX++] = ' ';
                    ptraccX[sLenAccX++] = ' ';
                    ptraccX[sLenAccX++] = ' ';
    
    
                    ptraccX[sLenAccX++] = ptraccY[0];
                    ptraccX[sLenAccX++] = ptraccY[1];
                    ptraccX[sLenAccX++] = ptraccY[2];
    
                    ptraccX[sLenAccX++] = ' ';
     ptraccX[sLenAccX++]...
    Read more »

  • A note on CCS UniFlash

    Roman03/26/2016 at 01:32 0 comments

      For your custom site you need to add all images and html files to the UniFlash configuration. Once all files are added flash the image.

      1. Open UniFlash

      2. File -> Open -> Target Configuration.

      The configuration file name for my Exosite is configRev01.usf. It has additional images I placed on the site, for example mad.png.

      Once configuration is opened click on Operation -> Add File. You will get a generic file which you will have to replace with your own.

      Rename the file and point to a file location.

      That is it, build your custom site on CC3200.

  • CC3200 MCU LaunchPad Hardware.

    Roman03/22/2016 at 21:25 0 comments

    CC3200 Development Board has a lot of useful hardware.

    The easiest way to start is to work with the two on-board sensors

    accelerometer and temperature and then expand to new

    sensors and other hardware.

    TMP006 Infrared

    Thermopile Sensor in Chip-Scale Package.


    BMA222 3-AXIS ACCELEROMETER DIGITAL SMD

    The following function deals with HTTP events. The source code can be downloaded from here. File name is ExositeCC3200CloudDemo-BETA-20140708.zip.

    void SimpleLinkHttpServerCallback(SlHttpServerEvent_t *pSlHttpServerEvent, 
                                    SlHttpServerResponse_t *pSlHttpServerResponse){
    ....
    }
    

    Two events are of a particular interest at this point.

    Temperature read:

    ptr = pSlHttpServerResponse->ResponseData.token_value.data;
    pSlHttpServerResponse->ResponseData.token_value.len = 0;
    if(memcmp(pSlHttpServerEvent->EventData.httpTokenName.data, 
    GET_token_TEMP, strlen((const char *)GET_token_TEMP)) == 0)
    {
    float fCurrentTemp;
    TMP006DrvGetTemp(&fCurrentTemp);
    char cTemp = (char)fCurrentTemp;
    short sTempLen = itoa(cTemp,(char*)ptr);
    ptr[sTempLen++] = ' ';
    ptr[sTempLen] = 'F';
    pSlHttpServerResponse->ResponseData.token_value.len += sTempLen;
    }
    Accelerometer

    read:

    if(memcmp(pSlHttpServerEvent->EventData.httpTokenName.data, 
    GET_token_ACC, strlen((const char *)GET_token_ACC)) == 0)
    {
    
    ReadAccSensor();
    if(g_ucDryerRunning)
    {
        strcpy((char*)pSlHttpServerResponse->ResponseData.token_value.data,"Running");
        pSlHttpServerResponse->ResponseData.token_value.len += strlen("Running");
            }
    else
    {
        strcpy((char*)pSlHttpServerResponse->ResponseData.token_value.data,"Stopped");
        pSlHttpServerResponse->ResponseData.token_value.len += strlen("Stopped");
    }
    }
    

    Both sensors share I2C bus for command and data communications.



  • Making Changes to CC3200 Web Page

    Roman03/20/2016 at 17:35 1 comment

    I am learning HTML, CSS, and JavaScript as I go with the project. I have made a couple of simple changes to the original front page :).

    The site is still working, I haven't broken it yet. You can find the site code in zip format here.

    I have changed the title, and inserted two images.

    <title>Thingamajiggy</title>
    </head>
    <body>
    <img src="images/hackaday.png" alt="Doc" style="width:50px;height:50px;">

    Thingamajiggy is the new title, there is a hackaday image at the top and I placed my image with a link to the demos page at the bottom of the page


    <style>
    .center {
        margin: auto;
        width: 90%;
        border: 0px solid #73AD21;
        padding: 1px;
    }
    </style>
    <div class="center">
    <a href="demos.html">
    	<img src="images/mads.png" alt="Doc" style="width:150px;height:150px;">  
    </a>

    I use Eclipse for JavaScript to work on the changes to the site.

View all 9 project logs

Enjoy this project?

Share

Discussions

Roman wrote 11/26/2016 at 14:45 point

Hi Boris, thank you for your positive comment. I haven't updated my Hackaday page in a while which I should do. I have my own webpage listed above with the same project where I keep all the updates. If I understand right you do not use WiFi for data transmission. 

  Are you sure? yes | no

Boris Bershadsky wrote 11/25/2016 at 16:31 point

Wow I just found this project from Google and this is a goldmine of useful information! The TI SDK References alone don't always cut it. I'm currently working on grabbing the data for the accelerometer and temperature sensor and simply printing the results to UART

  Are you sure? yes | no

Roman wrote 03/31/2016 at 23:38 point

Hi, I have managed to display Y and Z axis data using brut force. It seems to work, though sometimes I get weird data. I have updated my log "Updates on Exosite and Source code" with the code patches. I also uploaded updated files.

  Are you sure? yes | no

Roman wrote 03/28/2016 at 21:27 point

Hi, if you follow this project, I just posted an updated code link to my Google Drive. I learn a bunch of stuff as I go with this project. If you are familiar with JavaScript and/or AJAX let me know l would like to pick your brain. Thanks for following :).

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates