RN -13 1/1 71 -PICT AIL-U M RN-131-PICTAIL & RN-171-PICTAIL Evaluation Boards © 2012 Roving Networks. All rights reserved. RN-131/171-PICTAIL-UM Version 1.
RN -13 1/1 71-PICT AIL-U M OVERVIEW The RN-131 and RN-171 WiFly radio modules are complete, standalone wireless LAN access devices. Each module contains a TCIP/IP stack and related applications. After the module is configured, the radio can access the Wi-Fi network automatically, and transmit and receive data over a UART. General Description The RN-131-PICTAIL and RN-171-PICTAIL evaluation boards work seamlessly with the Microchip Technology PIC18 Explorer Development Board.
RN -13 1/1 71-PICT AIL-U M Demo Applications The example applications provided with this document include an MPLAB X project and 2 pre-compiled .hex files. • The MPLAB X project files provide a sample 8-bit application framework that you can customize to configure and control the RN-131/RN-171 from an 8-bit Microchip microcontroller. • You use the pre-compiled sample application ConfigureInCmdMode.hex to configure the RN-131/RN-171 module. • SampleTelnetApp.
RN -13 1/1 71-PICT AIL-U M Demo Applications This section demonstrates how to use the demo applications to accomplish the following tasks: • Configure the module to join a known, user-specified access point automatically. • Communicate with the module via a telnet session to turn on/off LEDs using a command set that the application running on the PIC recognizes. Set Up Hardware Perform the following steps to set up the hardware and prepare it for configuration: 1.
RN -13 1/1 71-PICT AIL-U M Figure 2. Jumper Selection for Command Mode Operation 3. Connect a serial cable from the PIC18 Explorer Board’s DE9 connector to the PC. If you are using a laptop that does not have a serial connector, use a USB-to-serial converter cable to connect the serial cable to the laptop’s USB port. 4. Connect the programmer to the PIC18 Explorer Board and apply power.
RN -13 1/1 71-PICT AIL-U M 3. Type the following commands in the console of your terminal emulator: $$$ This command places the RN-131/RN-171 module in command mode. scan The device scans for networks and produces a list of available access points (see Figure 3 for an example). The access point to which you wish to connect should be listed. If it is not, repeat the scan command.
RN -13 1/1 71-PICT AIL-U M Figure 4. Data Mode Operation Jumper Selection 2. Use the MPLAB X IDE and the programmer to load the SampleTelnetApp.hex demo application into the PIC18F87J11. 3. Press the MCLR reset button on the Explorer 18 board and observe the output transaction on the terminal emulator console. A normal sequence is similar to that shown in Figure 5, i.e.
RN -13 1/1 71-PICT AIL-U M Figure 5. RN-131/RN-171 Association Start-Up Sequence 4. NOTE: In the console, note the IP address that the access point assigns to the RN-131/RN-171 module. The IP is unique to each wireless environment’s DHCP server. You will use this IP address to open a telnet session with the device. The application source code includes a file called ConfigApp.h.
RN -13 1/1 71-PICT AIL-U M The RN-131/RN-171 module is now associated to an access point and is operating in data mode. Use the following steps to open a telnet session with the device and send it commands: 1. Associate your computer’s Wi-Fi connection with the same access point as the RN-131/RN-171 module. 2. On your computer, open a command line session and type the command: telnet
2000, where is the IP address of the RN-131/RN-171 module. For example: telnet 192.168.1.RN -13 1/1 71-PICT AIL-U M SAMPLE APPLICATION DESIGN This chapter provides a high-level overview of how the sample demo application was designed, and shows some of the APIs you can use to communicate with RN-171 module. Demo Application Flow Diagram Figure 6 shows the demo application flow diagram. Figure 6.
RN -13 1/1 71-PICT AIL-U M Initialize the PIC’s UART The void ConsoleInit(void) API function initializes the PIC’s UART1, which communicates with the RN-131/RN-171 module. It sets the UART’s baud rate to 9600 baud, 8 bits data, 1 stop bit, no parity, and no flow control. These settings are the default for the RN-131/RN-171 module. To change the baud rate, modify the #define BAUD_RATE 9600 macro in the console.h header file, and re-initialize the UART.
RN -13 1/1 71-PICT AIL-U M Primary Module Communications API Functions The API function that tells the device to go into command mode is: err_t module_send_cmd(const char *response, const char *fmt, ...) This function accepts 2 or more parameters (i.e., a variable length parameter list). The first parameter, response, is the reply expected from the RN-171 module after it has processed the command. The command is carried in the fmt parameter.
RN -13 1/1 71-PICT AIL-U M BOARD SCHEMATICS Figures 7 and 8 show the schematics for the RN-131-PICTAIL and RN-171-PICTAIL evaluation boards, respectively. Figure 7. RN-131-PICTAIL Board Schematic Vin U2 UART_TX 1 SEN3 32 33 SEN0 TC1262- 3.
RN -13 1/1 71-PICT AIL-U M Figure 8.
RN -13 1/1 71-PICT AIL-U M NOTES www.rovingnetworks.com Version 1.
RN -13 1/1 71-PICT AIL-U M Copyright © 2012 Roving Networks. All rights reserved. Roving Networks is a registered trademark of Roving Networks. Apple Inc., iPhone, iPad, iTunes, Made for iPhone are registered trademarks of Apple Computer. Roving Networks reserves the right to make corrections, modifications, and other changes to its products, documentation and services at any time.