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.

CC3220SF-LAUNCHXL: How to save wifi configuration

Part Number: CC3220SF-LAUNCHXL
Other Parts Discussed in Thread: CC3220SF, UNIFLASH

Hi Folks,

I created a HTML page where I'm trying to access HTML page and fill all the credentials for my wifi device. I'm able to access that HTML page in AP mode but how can I save in configuration file. Can anyone please assist me regarding this, I shall be  grateful for that.

  • Hi Manish,

    If you have an HTTP page already working with the HTTP post request handler, then I suggest you use the sl_WlanProfileAdd() API to add the credentials to the CC3220 NWP. See my post here for details:

    https://e2e.ti.com/support/wireless-connectivity/wifi/f/968/t/731447?CC3220S-LAUNCHXL-STA-mode-automatic-re-connect

    Regards,

    Michael

  • HI Michael,

    Let me check whether it works or not I'll inform you.

  • HI Michael,

    Issue whicj I'm facing is I'm able to open the HTTP Page and also entered my wifi credentials but when I'm clicking the submit button I see in the buffer all the values are zero but I'm getting Post request in Simplelink handler can hyou check my html file why my buffer is empty while posting.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    
    	<head>
    		<title>Configuration</title>
    		<style type="text/css">
    			h2{text-align:center;}
    			table {margin:0 auto; border-spacing: 20px 20px}
    			.Button {text-align: center;}
    		</style>
    	</head>
    
    	<body>
    		<h2>Wi-Fi Configuration</h2>
    		<form action="config.cgi" enctype="multipart/form-data" method="post">
    			<table>
    				<tr><td>SSID</td><td><input type="text" name="SSID" size="32"/></td></tr>
    				<tr>
    					<td>Security Type</td>
    					<td>
    						<select name="Sec_Type" >
    							<option value="OPEN">Open</option>
    							<option value="WEP">WEP</option>
    							<option value="WPA/WPA2">WPA/WPA2</option>
    						</select>
    					</td>
    				</tr>
    				<tr><td>Key</td><td> <input type="text" name="Key" size="32"/> </td></tr>
    			</table>
    			<div class="Button"> <input type="submit" value="Submit"/> </div>
    		</form>
    	</body>
    </html>
    
    

  • HI Manish,

    Looking at your HTML file, the main change I would make is to set the form encoding as "application/x-www-form-urlencoded". With that set, the SimpleLink NetApp request handler will copy the POSTed form data into netappRequest->requestData.pPayload. From there, you can strcmp() through the data to get the POSTed data. Once you have the data, you can use sl_WlanProfileAdd() to save the profile onto the device.

    I verified the above with your config.html and the out_of_box example from the SDK, so I suggest trying your file out in that example if you still run into issues. Some more notes:

    1. Ensure you flash the OOB files at examples/rtos/CC3220SF_LAUNCHXL/demos/out_of_box/uniflash/
    2. Ensure you set the Imagecreator project into 'development' mode after importing
    3. I suggest you use the 'addprofile' command in network terminal to skip the provisioning of the OOB example

    Regards,

    Michael

  • Hi Michael,

    As you have said ain above post "I verified the above with your config.html and the out_of_box example from the SDK." And you also said this I would make is to set the form encoding as "application/x-www-form-urlencoded". Can you please tell where to set the form encoding as "application/x-www-form-urlencoded" because I don't know anything about HTML. Please assist me show that you can move further to close this thread.

  • Hi Michael,

    Understood what you were trying to say. You are completely genius. Thanks dude