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.

CC3200 Webpage Server in Station mode?

Other Parts Discussed in Thread: CC3200, UNIFLASH

Hello,

I am working with the CC3200, and I am trying to make a webserver with it to be accessed locally by navigating to it's internal IP address on my network. I had started to use the Wlan_Station example to try and do this, however it does not actually make a webpage. Then i found the HTTPServer example, which does make a webpage. However, I cannot get it to connect to my network, instead it tries to setup it's own network instead - in AP mode. When I've tried to make it go into Station mode, I have had no luck. How do you set up the CC3200 in station mode using this HTTPServer example?

Thanks,

Harry

  • Hi,


    Please refer "Case 2 - STA Mode" section on processors.wiki.ti.com/.../CC32xx_HTTP_Server


    Regards,
    Aashish
  • Hi,

    I have gone through this example, but when I get to the part where I use the TI app, it says that it cannot find any devices. Additionally, if I connect to the CC3200 through my laptop, and input the details of the AP i want it to connect to, it shows this in the console:

                     *************************************************
                          CC3200 HTTP Server Application
                     *************************************************
    
    
    
    [WLAN EVENT] STA Connected to the AP: leicesterlab ,BSSID: 84:1b:5e:70:6c:20
    Host Driver Version: 1.0.0.10
    Build Version 2.0.7.0.31.0.0.4.1.1.5.3.3
    [WLAN EVENT]Device disconnected from the AP: leicesterlab,BSSID: 84:1b:5e:70:6c:20 on application's request
    Device is configured in default state
    
    Device is in AP Mode, Please Connect to AP [mysimplelink-2DF257] andtype [mysimplelink.net] in the browser
    

  • Hi,

    You, need to remove jumper at P58-Vcc.

    - kel
  • Hi,

    There isn't a jumper on P58-VCC.
  • Hi,

    Are you connecting through wifi router then your laptop? Have you set your wifi router details at common.h?

    - kel
  • Hi kel,

    No, I have connected directly to the CC3200 as it is in AP mode. I have put my wifi router details in, however when I start it up, it shows the message I included above. It is all working as intended when using AP mode.

    However I would like to be able to do the same thing but by connecting to my own router instead - so that the CC3200 behaves as a station instead so I can use any computer on my network to connect to the CC3200 webserver to turn the LEDs on the CC3200 on/off. Any help is appreciated.
    Thanks,
    Harry
  • Hi,

    I have tried the http_server many times.

    For troubleshooting, try the wlan_station example program. If it works then you are able to connect your CC3200 Launchpad in station mode. If that is then there is something wrong with your http_server example program. But, that is very unusual since I have tried the http_server example program many times.

    What other advice I can give you is format your CC3200, program latest service pack and then try the http_server again.

    - kel
  • Hi kel,

    I tried the wlan_station example program, and I am able to connect to my wireless AP successfully - there clearly isn't anything wrong with the hardware.

    When I run the http_server, after entering the AP settings in common.h, it does not try and connect to this AP; it instead runs in AP mode automatically.When I then connect to this AP the CC3200 has setup, and enter the router details in the profiles section and reset, it tries to connect to my AP. This is when it connects, and then disconnects "on application's request". Does this mean that there is something in the example program that is overriding the station mode?

    To clarify, I have not got any extra headers on other than the ones that are on the board already.

    Thanks for your support,

    Harry

     

  • Hi Harry,

    It seems you went into this condition below. A TI Engineer might explain what is cause of that.

    if(SL_USER_INITIATED_DISCONNECTION == pEventData->reason_code)
    {
    UART_PRINT("[WLAN EVENT]Device disconnected from the AP: %s,"
    "BSSID: %x:%x:%x:%x:%x:%x on application's request \n\r",
    g_ucConnectionSSID,g_ucConnectionBSSID[0],
    g_ucConnectionBSSID[1],g_ucConnectionBSSID[2],
    g_ucConnectionBSSID[3],g_ucConnectionBSSID[4],
    g_ucConnectionBSSID[5]);
    }

    Are you running httpserver under CCS? Try loading it to CC3200 Launchpad using Uniflash and then test it. Remove Jumper at SOP 2 before testing. If this does not work try testing httpserver at a different wifi router.

    - kel
  • Hi kel,

    Yes, I too found that piece of code, just trying to find out what the cause of it is is the pain! I was originally running it with CCS, but since then I have started using Visual Studio with VisualGDB.

    I will try it with a different router also, it could be due to the router blocking it I suppose - however I would expect it to behave in the same way that the wlan_station example did considering I am using the same router as I did for that! Is there anywhere I can post this problem to get the attention of a TI Engineer?

    Thanks very much,

    Harry
  • TI Engineers frequent this forum when they have time. Just wait for them to reply.

    I like you to test the httpserver in station mode stand alone, without debugging using CCS. Program httpserver using Uniflash and then test it as mentioned at the httpserver guide.

    As I have mentioned before, I have tried httpserver many times, because I have been studying it before. My setup is CC3200 Launchpad connected to my wifi router. There is nothing special about my wifi router, it is just the usual one anyone would use in their home.

    - kel
  • I will hang on then, hopefully they will be able to help!

    As for the testing of the station mode, you're talking about this guide I presume? processors.wiki.ti.com/.../CC32xx_HTTP_Server

    If so I will try it again, and see whether it works!

    Thanks,
    Harry
  • Hi Harry,


    . HTTP server application doesn't use AP information that defined in common.h; instead it uses smartconfig application to configure the AP information. As smartconfig not working you need to modify the code to use either common.h or configure information in AP mode and than switch to station mode the way you currently trying. To configure AP information you need to follow below steps:

    1. Comment from line# 1021 to 1028 means don't call ConfigureSimpleLinkToDefaultState() in HTTPServerTask() as it will delete all saved profiles that configured last time the same what happening currently. And recompile the code
    1. Put jumper on Pin58+VCC as describe on wiki
    2. Connect laptop to CC3200
    3. In browser type mysimplelink.net
    4. Go to "Profiles" tab
    5. Specify AP information in "Add profile" section and click on "Add" button.
    6. Remoce jumper from Pin58+VCC and reset the device.
    7. On boot up it will try to connect to AP that you configured in step 5.


    Regards,
    Aashish
  • Hi Aashish,

    That makes sense! I could tell from the terminal that It didn't want to even try and connect to the AP, instead just defaulting to AP mode. I have tried the steps you described, and when I ran it, it tried to connect to the AP I inputted. However, it still gets disconnected straight away:

                     *************************************************
                          CC3200 HTTP Server Application              
                     *************************************************
                                                                      
    
    
    [WLAN EVENT] STA Connected to the AP: JBNETGEAR ,BSSID: 0:18:4d:95:c:ee
    Host Driver Version: 1.0.0.1                                           
    Build Version 2.4.0.2.31.1.3.0.1.1.0.3.34
    [WLAN EVENT]Device disconnected from the AP: JBNETGEAR,BSSID: 0:18:4d:95:c:ee on application'
    s request 
    Device is configured in default state 
                                          
    Device is in AP Mode, Please Connect to AP [mysimplelink-2DF257] andtype [mysimplelink.net] i
    n the browser 
                  

    Additionally, when I stopped debugging and ran again, it still forgot the Profile I had specified. Would it be possible for you to describe how to make it use the common.h file? And beside from that point, I don't understand why it gets disconnected almost immediately from the AP.

    In the Code, there is a section which appears to be the part that may be making the CC3200 disconnect:

    case SL_WLAN_DISCONNECT_EVENT:
    			{
    				slWlanConnectAsyncResponse_t*  pEventData = NULL;
    
    				CLR_STATUS_BIT(g_ulStatus, STATUS_BIT_CONNECTION);
    				CLR_STATUS_BIT(g_ulStatus, STATUS_BIT_IP_AQUIRED);
    
    				pEventData = &pWlanEvent->EventData.STAandP2PModeDisconnected;
    
    				            // If the user has initiated 'Disconnect' request, 
    				            //'reason_code' is SL_USER_INITIATED_DISCONNECTION 
    				if (SL_USER_INITIATED_DISCONNECTION == pEventData->reason_code)
    				{
    					UART_PRINT("[WLAN EVENT]Device disconnected from the AP: %s,"
    					"BSSID: %x:%x:%x:%x:%x:%x on application's request \n\r",
    						g_ucConnectionSSID,
    						g_ucConnectionBSSID[0],
    						g_ucConnectionBSSID[1],
    						g_ucConnectionBSSID[2],
    						g_ucConnectionBSSID[3],
    						g_ucConnectionBSSID[4],
    						g_ucConnectionBSSID[5]);
    				}

    Clearly this is what is making it disconnect, the only issue Kel and I were having, is what is actually causing this to happen.

    Thanks for your help, hopefully you can shed some more light on this issue!

    Harry

  • Hi Harry,

    Another issue is why your SimpleLink Wi-Fi Starter App cannot detect the CC3200 Launchpad. What smart phone are you using? I use Iphone 4s and I am able to detect my CC3200 Launchpad using my SimpleLink Wi-Fi Starter App.

    - kel
  • Hi Harry,

    Use WlanConnect() API from wlan_station example rather than calling SmartConfigConnect() API.

    user4391279 said:
    [WLAN EVENT]Device disconnected from the AP: JBNETGEAR,BSSID: 0:18:4d:95:c:ee on application' s request

    Device sent disconnect request to AP as it switching to AP mode. Please make sure pin58 and vcc are not shorted.

    Regards,

    Aashish

  • Hi kel,

    I use a Samsung Galaxy S4. Would you be able to note down the steps that you follow, I'm almost certain that I followed it perfectly well. Additionally, I have tried it in a variety of ways to try and get it to work, but it doesn't find any devices.

    Thanks,
    Harry
  • Hi Aashish,

    I have checked, and PIN58 and VCC are definitely not shorted, unless there is something connecting them that I cannot see.
    I have tried changing the SmartConfigConnect() to WlanConnect from the wlan_station however it still seems to completely ignore it, and goes straight into AP Mode. I'm starting to think that it may be a harware problem...

    Thanks,
    Harry
  • Hi Harry,


    Run example in debug mode and put breakpoint at line#842 - "if(g_uiSimplelinkRole != ROLE_STA && g_uiDeviceModeConfig == ROLE_STA )" in ConnectToNetwork() see what is the value of g_uiSimplelinkRole and g_uiDeviceModeConfig.


    Regards,
    Aashish
  • Hi Aashish,

    After running with the breakpoint, g_uiDeviceModeConfig = 2, and g_uiSimplelinkRole = 0.

    Thanks,
    Harry
  • Hi Harry,

    g_uiDeviceModeConfig value is 2 means vcc and pin58 are shorted. Can you please put breakpoint inside the ReadDeviceConfiguration() and see it reading right value. And see voltage level at pin 58 is it high or low?


    Regards,
    Aashish
  • Hi Aashish,

    After realising that it was entering the "if" statement that you quoted, I changed ROLE_AP to ROLE_STA and it successfully connected to my Open AP. However when I changed the details to my WPA2 protected AP, it came up with some errors:

    
                     *************************************************
                          CC3200 HTTP Server Application              
                     *************************************************
                                                                      
    
    
    Host Driver Version: 1.0.0.1
    Build Version 2.4.0.2.31.1.3.0.1.1.0.3.34
    Device is configured in default state    
    Use Smart Config Application to configure the device.
    Error [-89] at line [120] in function [WlanConnect]  
    Error [-89] at line [1024] in function [ConnectToNetwork]  

    Nonetheless, it is certainly working more now than it has ever done, and I am going to look at these lines to see what is playing up!

    Thanks,

    Harry

  • After a quick look, It appears to be:

    	ASSERT_ON_ERROR(lRetVal);

    that is throwing the errors, do you know why it may be doing this?

    Thanks,

    Harry

  • Hi Harry,


    -89 error (SL_ERROR_PASSWORD_ERROR) means entered password is wrong. Can you please cross check password is right.


    Regards,
    Aashish
  • Hi Aashish,

    Ah right, so that would explain it! The password for my router has an exclamation point, would this interfere with it?

    Thanks,
    Harry
  • Hi Aashish,

    I have been able to get the CC3200 to connect to my AP - I changed the value of:

    #define BSSID_LEN_MAX       6

    to:

    #define BSSID_LEN_MAX       12

    which solved it for me!

    Now that I have been able to connect it to my AP, I connected to it via it's Internal IP address. It appears as though there isnt a "Demo" tab, so I cannot control the LEDs. Would you be able to talk me through the steps to implementing my own Webpage, or altering the webpage that is on it currently to display my own information?

    Thanks a lot for all your help, it has been very useful!

    Harry

  • Hi Aashish,

    Where abouts would the Simple_Link.css file be saved, I'm trying to find it to edit it, however It is eluding me.

    Thanks a lot,

    Harry
  • Hi Harry,

    Did you follow below steps?

    • Open <cc3200-sdk>\examples\httpserver\html\httpserver.ucf session file in Uniflash.
    • Flash the files to the device. Detailed instructions at Uniflash User Guide.

    If you are not able to find "Demo" tab then try with mysimplelink.net/led_demo.html.

    Also refer section 12 "HTTP Server" on http://www.ti.com/lit/ug/swru368a/swru368a.pdf for custom webpage.

    Regards,

    Aashish

  • Hi Aashish,

    I have been able to find the "Demo" tab, I re-flashed the CC3200 which did the trick, as you said. Currently, I am having difficulty trying to find/make my own Simple_link.css file. I have tried to find where it is saved, I can't see how the Main.html has access to it. I have tried to change the .css file that it points to, and taking the HTML code from the browser's source explorer and putting it in my own file. However, this doesn't work, and the formatting is not the same. Where is the Simple_link.css stored?

    Thanks,

    Harry
  • Hi Haryy,


    There is no css file for http server example. If you want to see format you may refer in websocket_camera/html. To use simple_link.css file flash it www/simple_link.css


    Regards,
    Aashish
  • Hi Aashish,

    I realised where I went wrong, I had flashed my .css file to the CC3200, but had missed off the www/ part of it. When I added this to the file name, it worked!

    Currently I'm trying to work out what code the ON/OFF switch in the Demo tab triggers, to try and play around with it and add more of them etc.

    Thanks,

    Harry
  • Hi Aashish,

    I have been able to get the Webpage working. My end goal is to integrate the CC3200 audio BoosterPack with my current program, so that I can take the audio input from the MIC onboard the CC3200 Audio BoosterPack and display an average frequency or some form of averaging of the input on the webpage. Would you be able to point me towards an example that utilises this, so I can see what pins and stuff need to be initialised and the code etc. 

    Thanks,

    Harry

  • Hi Harry,


    Please refer wifi_audio demo for audio.


    Regards,
    Aashish
  • Hi Aashish, by any chance do you know what the following error is caused by:

    Cortex_M4_0: Error connecting to the target: Frequency is out of range.

    Thanks,

    Harry

  • Hi Harry,

    Does this error occurred at CCS or Uniflash? After power cycling your CC3200 Launchpad, does the same error occur?

    Using Uniflash format your CC3200 Launchpad, if there are any errors post it here.

    - kel
  • Hi kel,

    This error is occurring in CCS. After power cycling the CC3200, the same error is still occuring. It is important for me to note that this is a different program from the one that I was previously asking about, it is the uart_demo that I had altered to work as a musical keyboard by taking inputs from the computer keyboard. I, out of interest, went back to this program to ensure it was still working and this is the error that greeted me. I have used uniflash to format it, and it does not come up with any errors within uniflash itself - but the error persists in CCS. I can't think what else I have changed...

    Thanks for your help,

    Harry
  • After trying the wifi_audio_app, it too comes up with the error of:

    Cortex_M4_0: Error connecting to the target: Frequency is out of range.

    So clearly it is a problem with the CC3200 itself...

    Any ideas?

    Thanks,

    Harry

  • Hi Harry,


    Can you please try blinky or some other application? Also try on IAR and see whether same occurring or not.


    Regards,
    Aashish
  • Hi Aashish,

    I was able to solve the problem, and I am no longer working on the application we were discussing. Thanks very much for all of your help, it was very useful.

    Best Regards,

    Harry

  • Hi Harry,
    Can you share the way you used to solve the problem?
    I'm trying to use HHTP Server as station as well but no luck...
    Thanks,
    Itay