Latest update: July 2013
It is good idea to change the SSID and the network key to ensure a safe communication via Wireless LAN. This tutorial will explain how to set the SSID and network key of your FlashAir device.
In this tutorial, we will create a web application which can configure the SSID and network key of your FlashAir device. You can use command.cgi to get the current SSID and network key, and config.cgi to set the SSID and network key.
NOTE: It is not possible to get or set the network key if the FlashAir is configured to the Station mode. Please configure the card to the Access Point mode.
We need MASTERCODE to change the configuration of the FlashAir. MASTERCODE is a kind of password to restrict access to the configuration file to the authorized users.
Usually the MASTERCODE is the MAC address of the device that the FlashAir was set up with if we use the official Browser Utility or smartphone apps. We will use an API to get the MAC address and use it as the MASTERCODE for this sample program.
We assume the FlashAir card is initialized with the official tools, and we will use the same device used for the initialization as a target device in this tutorial.
NOTE: We have displayed the MASTERCODE in this tutorial application to demonstrate how the
device works. This information is provided for tutorial purposes only. For security
we highly discourage you from publicly displaying your MASTERCODE. Also, password should be
by masking characters like
We will save the HTML file as
/SD_WLAN/Config.htm on the FlashAir.
When the page is loaded, you will get the MASTERCODE, APPSSID, and APPNETWORKKEY after command.cgi is called.
When you call
config.cgi on click the button, you can set new
values for the APPSSID and APPNETWORKKEY.
If this command is successful,
SUCCESS is returned.
ERROR is returned. The return value will be shown on screen.
getMasterCode()function. Inside this function, a call is made to command.cgi?op=106 and the response is stored for later use.
getSSID()function. Inside this function, a call is made to command.cgi?op=104.
getAPPNETWORKKEY()function. Inside this function, a call is made to command.cgi?op=105.
setParams()function (line 21) to a click event.
Save the program on the FlashAir, and open your web browser on your PC or smartphone connected to the FlashAir. Input the following URL into the URL box of your web browser.
The current configurations will be shown on the screen. (Left image.) You can modify the
as you edit the values and click
submit button. If this command is successful,
SUCCESS will be shown. (Right image.)
Note that wireless connection will be disconnected after configuration command is issued. You need to reconnect your device to the FlashAir with the new SSID.
All sample code on this page is licensed under BSD 2-Clause License