Created by Matthew Bon, last modified by BenH on Aug 31, 2016
Background:
The Panasonic Pan9320 is an embedded Wifi module that offers a great deal of functionality while also being very simple to use. This article will demonstrate how to utilize the basic functionality of the Pan9320 module using Panasonic’s wifiguator software, a terminal emulator and a host microcontroller.
Acknowledgments :
I would like to thank Christopher Hultsch, a field engineer for Panasonic. I had to opportunity to attend one of his seminars a while back where he not only introduced me to the Pan9320, but also demonstrated how to implement several different features of the module. Thus this article owes him a great deal of debt.
Useful Links:
PAN9320_series_data_sheet.pdf (1.6 MB)
Configuring the Module using Panasonic’s Wifigurator:
Background:
Wifigurator is an evaluation program provided by Panasonic. It is a simple GUI that enables the user to quickly and easily test and evaluate the different functions of the PAN9320 module. This section will demonstrate how to use Wifigurator to enable basic module functions such as reading out device information, setting up an access point and configuring the module in infrastructure/station mode.
Required Hardware:
USB A to USB B cable such as this one: AE1462-ND
Windows PC with the necessary FTDI drivers installed
Required Software:
Wifigurator downloaded from: PAN9320 Panasonic Page
Examples:
Example 1 - Initial Setup
-
Download and unzip the Wigfigurator folder from Panasonic’s PAN9320 page listed above. The program runs from an executable so there is no need to install anything.
-
Connect the PC to USB0 on the evaluation kit. Two COM ports should enumerate. After a few seconds, the ‘Ready’ light on the daughter board should turn on.
-
Open Wifigurator by double-clicking on the Wifigurator.exe file. The following screen should appear. You can get rid of the splash screen by clicking the ‘Start’ button.
-
Select the proper COM port from the drop down menu in the upper left of the GUI. Of the two COM ports that enumerated, you will want to select the COM port with the higher number, (e.g if COM4 and COM5 enumerated, select COM5). Then hit the ‘Connect’ button. Once the connection is established, you should see a screen similar to the one below:
-
The last thing to do is to read out the device information. To do this, simply click the ‘Read Out’ button in the GUI. You should see s screen similar to the one below.
Example 2 - Setting up an Access Point
-
If you haven’t done so already, follow steps 1-4 in the ‘Initial Setup’ section to ensure that a proper connection between the evaluation kit and your PC have been established.
-
Under the ‘Modes’ section, ensure that ‘Access Point’ is selected.
-
Under the ‘Access Point’ section, set the SSID, Security and Key to whatever you see fit.There is no need to change the Channel parameter as the module will automatically configure itself to the proper channel. An example configuration is shown below:
-
Once the parameters have been configured, click the ‘Set’ button. After a few seconds, the wifi network should appear. Connect your pc to the network.
-
Once connected to the access point, open a web browser. Enter the address 192.168.1.1 into the web browser, this will take you to the website hosted on the PAN9320 module. The module may prompt you for a username and password. The default for both is ‘admin’.
-
The default site hosted on the module contains a tutorial for the part as well as a configuration page that will allow you to to modify the functionality of the module in a manner similar to wifigulator.
Example 3 - Setting up Station/Infrastructure Mode
-
If you haven’t done so already, follow steps 1-4 in the ‘Initial Setup’ section to ensure that a proper connection between the evaluation kit and your PC have been established.
-
Under the ‘Modes’ section, ensure that ‘Infrastructure’ is selected.
-
Under the ‘Infrastructure’ section, click the ‘Scan’ button. A blue light should start blinking on the daughter board. After it stops blinking, hit the ‘Get List’ button. The access points that the module found during its scan will now be displayed in the ‘Communication’ window of the Wifigulator GUI.
For each network found, the GUI will list the SSID, a number signifying the security type of the network and a number which correlates to the network’s signal strength. The first number after the SSID is the security number and you can find a table for them below. The second number is the signal strength which is based on the RSSI values which have been normalized to scale where 0 is the weakest detectable signal and 100 is the strongest.
Number | Security Type |
---|---|
1 | Open |
2 | WEP |
3 | WPA |
4 | WPA_2 |
5 | WPA_Mixed |
- Under the ‘Infrastructure’ section, enter the desired SSID from the list as well as the security setting and key/password. Then, hit the connect key. If the connection is successful, you will see a message similar to the one below, otherwise an error message will appear.
Configuring the Module via a Terminal Program:
Background:
While Wifiguator is a nifty piece of software, it is often times more convenient to use a simple terminal emulator to configure the module. This section will walk through the process of using a terminal emulator to configure and control the module.
Required Hardware:
USB A to USB B cable such as this one: AE1462-ND
Windows PC with the necessary FTDI drivers installed
Required Software:
Terminal Emulator such as a Putty.
Examples:
Example 1 - Initial Setup
-
Connect the PC to USB0 on the evaluation board via USB. Ensure that both com ports emulate.
-
To ensure that the commands you are sending to module are properly formatted, it is necessary to ensure that your terminal emulator generates a carriage return for every line feed and vice versa. It is also handy to have Local Echo and Local Line Editing turned on. To enable these in Putty, click on ‘Terminal’ in the left half of the Putty configuration window. Check the boxes ‘Implicit CR in every LF’ and ‘Implicit LF in every CR’ and select ‘Force On’ for both Local Echo and Local Line Editing.
-
Now that the terminal is configured, the serial connection can be setup up. Click on ‘Serial’ in the bottom left hand corner of the Putty configuration window. Of the two com ports that emulated when the evaluation kit was plugged in, select the one with the higher number. Set the baud rate to 115200, the data bits to 8, the stop bits to 1, parity to ‘none’ and the flow control to ‘none’.
-
Click on ‘Session’ in the upper left hand corner of the Putty configuration window. Select ‘Serial’ from the connection type options. The com port and baud rate you set in step 3 should auto-populate. Then, click the ‘Open’ button.
-
A terminal window should open. You should now be able to send commands to the module by typing them in the terminal window and hitting the enter key. The format of the commands can be found in the com-spec document shown in the section above. As an example, to get the system firmware version, you would type ‘get system firmware’ into the window and hit enter, the module should respond by echoing your command followed by a ‘0’ and the version number. The picture below shows that command along with several other basic information commands.
Example 2 - Setting up an Access Point
-
Establish a terminal connection with the board as shown in the initial setup section above.
-
Ensure the module isn’t in AP mode by sending the command ‘set wlan ap_mode off’
-
Set the parameters of the AP by calling sending the ‘set wlan ap_confg’ command. The arguments for this command are SSID, passoword, security type and radio channel. For example, the command ‘set wlan ap_confg Pan9320 password 4 0’ would setup an AP where the SSID is Pan9320, the password is password, the security is WPA2 and the module will automatically select the wifi channel with lowest noise.
-
Now that the AP is configured, it can be enabled by the command ‘set wlan ap_mode on’. After a few seconds the AP should appear.
-
The module also supports several commands to get basic information about the AP. Two of these commands are shown below, the rest can be found in the Pan9320’s com-spec.
Example 3 - Setting up Station/Infrastructure Mode
-
Establish a terminal connection with the board as shown in the initial setup section above.
-
Put the module in infrastructure mode by sending ‘set wlan infra_mode on’
-
Have the module search for available networks by sending ‘set wlan scan’
-
Once the scan is complete, you can view the results by sending ‘get wlan list’
-
You can connect to one of these networks by sending ‘set wlan infra_cfg’. When you send this command, you’ll also have to send the SSID, password and security type so your command will look something like ‘set wlan infra_cfg Beaglebone, *******, 4’
-
Like AP mode, the module also supports several commands to get basic information about status of the module in infrastructure mode. Several of these commands are shown below, a full list can be found in the comm-spec.
-
The photo below demonstrates how to ping another device using the Pan9320. In this case, I’m pinging the BeagleBoard-X15 & wifi adapter serving as my access point. As a side note, thanks to Robert Nelson I’m one of the few people who’ve actually pinged an X-15 or seen an X-15 for that matter…at least at the time of the writing of this article at any rate.
Interfacing the Module to a Host Microcontroller:
Required Hardware:
Any microcontroller with a UART and 3.3v logic levels. For this example, I used Cypress’s PSOC 4.
A swtich of some sort to initiate the program. (For the PSOC 4, we’ll use the button on its development board, SW1).
Required Software:
Software to program the microcontroller, in my case I used Cypress’s PSOC Creator.
A Simple Configuration Program:
This section details a very simple program in which the PSOC 4 configures the Pan9320 to act as an access point as well setup a Netcat server on the device.The way it works is as follows; the processor waits until the user pushes a button at which point the processor will then print out the command strings over its uart. The processor will pause after each command is issued in order to give the Pan9320 time to process each command. Generally speaking, it’s a good idea to read in and parse the responses from the Pan9320 so that you can be sure that each command has been entered successfully. However, for this demo, we can get by with simply entering the commands. The Main.c file for the program is shown below.
Program C Code
/* ========================================
*
* Copyright YOUR COMPANY, THE YEAR
* All Rights Reserved
* UNPUBLISHED, LICENSED SOFTWARE.
*
* CONFIDENTIAL AND PROPRIETARY INFORMATION
* WHICH IS THE PROPERTY OF your company.
*
* ========================================
*/
#include <project.h>
/*Function Prototypes*/
void Setup_AP();
void Setup_Netcat_Server();
int main()
{
CyGlobalIntEnable; /* Enable global interrupts. */
UART_Start();
while(Pin_1_Read() != 0)
{
}
Setup_AP();
Setup_Netcat_Server();
for(;;)
{
}
}
void Setup_AP()
{
UART_PutString("set wlan ap_mode off\r\n");
CyDelay(1000);
UART_PutString("set wlan ap_cfg pan9320 password 4 0\r\n");
CyDelay(1000);
UART_PutString("set wlan ap_mode on\r\n");
CyDelay(1000);
}
void Setup_Netcat_Server()
{
UART_PutString("set netcat mode server\r\n");
CyDelay(1000);
UART_PutString("set netcat tcp_port 12345\r\n");
CyDelay(1000);
UART_PutString("set netcat auth off\r\n");
CyDelay(1000);
UART_PutString("set binuart cfg 115200 8 0 1 1\r\n");
CyDelay(1000);
UART_PutString("set netcat telopt off\r\n");
CyDelay(1000);
UART_PutString("set netcat state on\r\n");
CyDelay(1000);
}
If you happen to be a Cypress user, I’ve attached the complete PSOC Creator project below. If you would like to perform this example but are not familiar with PSOCs; I would recommend you read Scott Schmidt’s article: Getting Started with PSoC 4 Prototyping Kits - CY8CKIT-049
PAN9320.zip (2.4 MB)
Setting up the Hardware and Configuring the Module:
- Ensure the jumpers on the evaluation kit are set as follows:
Jumper | Position |
---|---|
JP1 | Unused, can be open or closed |
JP2 | Unused, can be open or closed |
JP5 | Open |
JP6 | Set to EXT-PWR |
JP7 | Closed |
-
Attach an external 3.3V power source to the evaluation board as shown in the photo below:
-
Ensure your microcontroller is programmed with the example program. After it is programmed, attach the power and ground lines of the microcontroller to the same power source you are using to power the Pan9320. Then, attach the TX line of your microcontroller’s UART to the RX0 terminal on JP5 and the microcontroller’s RX line to the TX0 terminal on JP5. Once all the connections are setup, power can be applied to the kit. An example of this setup is shown below:
-
Wait for several seconds for the Pan9320 to initialize. After that, press the switch attached to the microcontroller (SW1 in the case of the CY8CKIT). This will start the process of configuring the module. If the configuration is successful, an access point named Pan9320 should appear after about a minute or so.
Comments
Any questions or comments please go to our TechForum: TechForum