Jump to content
43oh

CC3200 Use the inbuilt web server for provisioning ap


Recommended Posts

As an alternative to SmartConfig I want to use the inbuilt web server to allow the user to enter his/her network details I also want to be able to allow a push button type WPS function

 

There are TI examples provisioning_ap and provisioning_wps, essentially, I want to port these to Energia

 

starting with the AP

 

my simplistic attempts have not yielded any results.

 

I flashed the provisioning_ap example to my launchpad and also to a custom board and it worked as advertised.

 

I then flashed my Energia sketch expecting it to trigger the callback.

 

I can log into the Energia AP and the TI web pages are displayed but it didn't print my message.

 

I have read the sections in the SWRU368A.PDF and looked at the sample code but the

TI examples are so verbose and often seem to have unnecessary levels of abstraction (especially for an example) 

 

So can anyone offer some suggestions on how to use the inbuilt web server with Energia?

 

This is the code/sketch because someone is going to ask to see it.

#include <WiFi.h>
#include <WiFiClient.h>
#include <WiFiServer.h>
#include <WiFiUdp.h>

// AP Provisioning

const char ssid[] = "MyEnergiaAP";
const char wifipw[] = "password";
long   retVal = -1;
int i;

void setup()
{
  Serial.begin(115200);

  Serial.print("Setting up Access Point named: ");
  Serial.println(ssid);
  Serial.print("AP uses WPA and password is: ");
  Serial.println(wifipw);

  WiFi.beginNetwork((char *)ssid, (char *)wifipw);
  while (WiFi.localIP() == INADDR_NONE) 
  {
    // print dots while we wait for the AP config to complete
    Serial.print('.');
    delay(300);
  }
  Serial.println();
  Serial.println("AP active.\r\n");

}

void loop()
{


}

void SimpleLinkHttpServerCallback(SlHttpServerEvent_t *pSlHttpServerEvent,
        SlHttpServerResponse_t *pSlHttpServerResponse)
{
  Serial.println("I'm Here SimpleLinkHttpServerCallback");
}

Trevor.

Link to post
Share on other sites
  • 2 months later...

I also am looking for help in programming some web pages used when in AP mode.   The above code (or similar) i got working for connections, but again never got a webpage to function, and only get the built in TI pages.

Does anyone have a basic guide to webpage programming (including flashing and the mysterious "tokens") using the Energia IDE?   

 

Update: I did just find a bunch of great info in the WIFIGuide.pdf from TI and in it it does say... which may be applicable

 
For the HTTP callback to work the following line should be uncommented in user.h:
#define sl_HttpServerCallback SimpleLinkHttpServerCallback
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...