RN -W IFLY CR-U M- .01 RN-WIFLYCR-UM WiFly Command Reference, Advanced Features & Applications © 2012 Roving Networks. All rights reserved. RN-WIFLYCR-UM Version 1.0r 9/21/2012 www.rovingnetworks.
RN -W IFLYCR -U M Contents Introduction ....................................................................................................................... 5 Features ....................................................................................................................................... 5 Configuration ................................................................................................................................ 6 Entering Command Mode ..................
RN -W IFLYCR -U M UART Heartbeat Messages ....................................................................................................... 58 Using the Real-Time Clock Function ............................................................................................. 59 Time Stamping Packets ............................................................................................................... 60 Advanced Applications ......................................................
RN -W IFLYCR -U M COMM PARAMETERS ................................................................................................................. 81 DNS PARAMETERS .................................................................................................................... 81 FTP PARAMETERS ..................................................................................................................... 81 IP PARAMETERS ...........................................................
RN -W IFLYCR -U M INTRODUCTION The Roving Networks WiFly radio module is a complete, standalone embedded wireless LAN access device. The device has an on-board TCP/IP stack and applications, and in the simplest configuration only requires four pins (power, TX, RX, and ground). Once you have performed the initial configuration, the device automatically accesses a Wi-Fi network and sends/receives serial data over the UART.
RN -W IFLYCR -U M • • Hardware: o 8-Mbit flash memory and 128-Kbyte RAM, 2-Kbyte ROM, 2 Kbyte battery-backed memory o 10 general-purpose digital I/O pins (RN-131) o 14 GPIO pins (RN-171) o 8 analog inputs (14 bits, 1.
RN -W IFLYCR -U M mode may cause the UART to become unresponsive briefly. To avoid configuration problems, the auto-associate feature is disabled when the module is in command mode, making it easy to configure the module. The auto-associate mode turns on when you exit command mode. NOTE: If your module is running firmware version 2.20 or lower, the auto-associate feature is NOT disabled when the module is in command mode.
RN -W IFLYCR -U M COMMAND REFERENCE Roving Networks WiFly modules support a variety of commands for configuration. This section describes these commands in detail and provides examples. COMMAND SYNTAX To issue commands to the module, you send a keyword followed by optional parameters. Commands are case sensitive, and you cannot use spaces in parameters. Use a $ to indicate a space, e.g., MY NETWORK should be written as MY$NETWORK. Hex input data can be uppercase or lowercase.
RN -W IFLYCR -U M When the system boots, all configuration data is loaded into RAM variables from the config file. The set commands only modify the RAM copy of the system variables. In general, the IP, WLAN, and UART settings require you to save and reboot before they take effect because they operate upon power up. For example, you only associate, set the channel, and obtain an IP address once at power up. Most of the other commands, e.g.
RN -W IFLYCR -U M set adhoc probe This command sets the ad hoc probe timeout in seconds, where is the number of seconds. The probe timeout is the number of seconds the module waits for probe responses before declaring, “ADHOC is lost,” and disabling the network interface.
RN -W IFLYCR -U M set comm $ This command sets character used to enter command mode to . You typically use this setting when $$$ (the default string used to enter command mode) is a possible data string. You must carefully note the new character. After you save this setting, upon every subsequent reboot the module ignores $$$ and looks for to enter command mode.
RN -W IFLYCR -U M set comm match | This command sets the match character, where is a decimal number from 0 to 127 or a hex number from 0 to 7F. When this configuration option is set, the module sends an IP packet each time the match character appears in the data. You enter either as the decimal (e.g., 13) or hex (e.g., 0xd) equivalent of the of the ASCII character. Setting the match character to 0 disables matching.
RN -W IFLYCR -U M set dns address
This command sets the IP address of the DNS sever, where is an IP address in the form ... with being a number between 0 and 255. This address is automatically set when using DHCP; you must set the DNS IP address for static IP or automatic IP modes. Default: 0.0.0.0 Example: set dns address 169.64.1.1 // Set the DNS server address to 169.64.1.RN -W IFLYCR -U M set ftp filename This command sets the name of the file that is transferred when issuing the ftp u command, where is the firmware image. If you specify any file other than the firmware image, the WiFly module downloads the file and issues the UPDATE FAIL=3 error. Default: wifly_GSX-.img (RN-131), wifly_EZX-.
RN -W IFLYCR -U M set ip address
This command sets the WiFly module’s IP address, where is an IP address in the form ... with being a number between 0 and 255. If DHCP is turned on, the IP address is assigned and overwritten when the module associates with an access point. IP addresses are “.” delimited. Default: 0.0.0.0 Example: set ip a 10.20.20.1 // Sets the WiFly module’s IP address to 10.20.20.RN -W IFLYCR -U M set ip flags This commands sets the TCP/IP functions, where is a hex number referring to a bit-mapped register. See Figure 1. Figure 1. set ip flags Command Bit-Mapped Register 7 6 5 4 3 2 1 0 TCP connection status. See Notes (1), (2). Bypass Nagle algorithm and use TCP_NODELAY. TCP retry enabled (for a total of 96 packet retries). UDP RETRY (attempts retry if no ACK from UDP). DNS host address caching enabled. ARP table caching enabled. UDP auto pairing enabled.
RN -W IFLYCR -U M set ip localport This command sets the local port number, where is a decimal number representing the port. Default: 2000 Exampl: set ip localport 1025 // Sets the local port to 1025 set ip netmask This command sets the network mask, where is an IP address in the form ... with being a number between 0 and 255.
RN -W IFLYCR -U M Figure 3. set ip tcp-mode Command Bit-Mapped Register 4 3 2 1 0 Shorten the TCP connect timer (use with bit 1). Shorten the TCP connect timer (use with bit 0). Forces the module to use DNS first to resolve the IP address, even if the host IP is set. Reserved. Disables remote configuration for security purposes.
RN -W IFLYCR -U M set opt replace This command sets the replacement character you use to indicate spaces in the SSID and pass phrases, where is a single character. Each occurrence of the replacement character is changed into a space. Only the WiFly command parser uses this replacement character.
RN -W IFLYCR -U M set q power This register automatically turns on the sensor power, where is shown in Table 5. This parameter sets an 8-bit register with two 4-bit nibbles. If the top nibble is set, power is applied upon power up and removed upon power down or sleep. If the bottom nibble is set, power is applied when a sampling event occurs such as: • UDP broadcast • Automatic web posting of sensor data • Power is removed immediately after sampling is complete Table 5.
RN -W IFLYCR -U M set sys autoconn This command sets the auto-connect timer in TCP mode, where is a decimal number from 0 to 255 as shown in Table 6. Setting this parameter causes the module to connect to the stored remote host periodically as specified by . NOTE: To use the auto-connect timer, you must store the remote host’s IP address and port in the WiFly module using the set ip host and set ip remote commands. Table 6.
RN -W IFLYCR -U M set sys mask This command sets the I/O port direction, where is a hex number referring to a bit-mapped register. For more details see “Setting GPIO Direction, Alternate Functions & Disabling LEDs” on page 51. NOTE: To set the GPIO pins as inputs or outputs instantly, use the set sys mask 0xABCD 1 command, which does not require a reboot.
RN -W IFLYCR -U M set sys sleep This command sets the sleep timer, where is a decimal number. The sleep timer is the time (in seconds) after which the module goes to sleep. This timer is disabled during an open TCP connection. When the TCP connection is closed, the module counts down and puts the module to sleep after seconds. Setting the value to 0 disables the sleep timer, and the module will not go to sleep based on this counter.
RN -W IFLYCR -U M Setting the trigger value to 0x20 (i.e., using ) puts the module to sleep when GPIO8 is pulled high. To enable this feature, use the set sys trigger 0x20 command. This command makes GPIO8 an interrupt pin and puts the module to sleep as soon as it is pulled high, regardless of the module’s state; the module goes to sleep even if it is associating with a network or has an open, active TCP connection.
RN -W IFLYCR -U M set time port This command sets the time server port number, where is a decimal number. 123, the default, is typically the SNTP server port. Default: 123 Example: set time port 1052 // Sets the time server port to 1052 set time enable This parameter tells the module how often to fetch the time from the specified SNTP time server, where is a decimal number representing minutes. The default (0) disables time fetching.
RN -W IFLYCR -U M set uart instant This command immediately changes the baud rate, where is 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400, 460800, or 921600. This command is useful when testing baud rate settings or when switching the baud rate “on the fly” while connected over TCP via telnet. Using this command does not affect configuration. The module returns the AOK response, and then the module exits command mode. NOTE: In firmware version 2.
RN -W IFLYCR -U M set uart raw This command sets a raw UART value, where is a decimal number representing the baud rate. You use this command to set non-standard baud rates. The lowest possible baud rate is 2,400. Using non-standard raw baud rates with hardware flow control can be more useful at speeds as the microcontroller interfaced to the module may be able to better match the UART speed and get better results. Table 10 shows the supported raw baud rates: Table 10.
RN -W IFLYCR -U M set wlan auth This command sets the authentication mode, where is shown in Table 11. You only need to set this parameter if you are using automatic join mode 2, i.e., the set wlan join 2 command. NOTE: During association the module interrogates the access point and automatically selects the authentication mode.
RN -W IFLYCR -U M set wlan channel This command sets the WLAN channel, where is a decimal number from 1 to 13 representing a fixed channel and is the optional character i (meaning immediate). If you set the channel to 0, the modules performs a scan using the SSID for all the channels set in the channel mask. The i flag allows you to create a temporary AP mode setup without having to reboot or save the settings. See Example 2.
RN -W IFLYCR -U M set wlan join This command sets the policy for automatically associating with network access points, where is one of the options shown in Table 12. The module uses this policy on powers up, including waking up from the sleep timer. Table 12. set wlan join Command Options Value Policy 0 Manual. Do not try to associate with a network automatically. 1 Try to associate with the access point that matches the stored SSID, passkey, and channel.
RN -W IFLYCR -U M set wlan key This command sets the 128-bit WEP key, where is EXACTLY 26 ASCII chars (13 bytes) in hex without the preceding 0x. Hex digits greater than 9 can be either upper or lower case. If you are using WPA or WPA2, enter a pass phrase with the set wlan passphase command. Default: Not applicable Example: set wlan key 112233445566778899AABBCCDD // Sets the passkey NOTE: The module only supports open mode, 128-bit keys for WEP.
RN -W IFLYCR -U M set wlan rate This command sets the wireless data rate, where is a value shown in Table 13. Lowering the data rate increases the effective range of the module. Table 13. set wlan rate Command Options Value Wireless Data Rate (Mbits/second) 0 1 1 2 2 5.
RN -W IFLYCR -U M set wlan tx This command sets the Wi-Fi transmit power, where is a decimal number from 1 to 12 that corresponds to 1 to 12 dBm. The default, 0, corresponds to 12 dB, which is the maximum TX power. Setting the value to 0 or 12 sets the TX power to 12dBm. NOTE: This command applies only to the RN-171 module; it is not applicable to the RN-131. The transmit power on the RN-131 is fixed to 18 dBm.
RN -W IFLYCR -U M get ftp This command displays the FTP settings. Example: get ftp // Show the FTP setttings get ip This command displays the IP address and port number settings, where is the optional parameter a. Using returns the current IP address. Example: get ip a // Display the current IP address get mac This command displays the device’s MAC address.
RN -W IFLYCR -U M ver The command displays the firmware version. Example: ver // Show the firmware version STATUS COMMANDS These commands begin with the keyword show and they return the current values of the system variables. In some cases, e.g., IP addresses, the current values are received from the network and may not match the stored values. Except where noted, the show commands do not have any parameters.
RN -W IFLYCR -U M show q This command displays the value of the analog interface pin, where is 0 to 7. The A/D reading is 14 bits with a range of 0 to 400 mV (therefore, the resolution is 24 uV). The output is in uV (1,000 millivolts). The module returns a value in the format 8xxxxx, where xxxxx is the voltage in microvolts sampled on the channel you requested. NOTE: If a web post or UDP broadcast samples the data, the data is shifted as described in “UDP Broadcast” on page 62.
RN -W IFLYCR -U M ACTION COMMANDS The action commands allow you to enter and exit command mode, join networks, etc. Except where noted, these commands do not have any parameters. $$$ You use this command to enter command mode. You must type $$$ together quickly with no additional characters before or after. You must not type a carriage return () after the $$$ to enter command mode. The module replies with CMD to indicate it is in command mode.
RN -W IFLYCR -U M join This commands instructs the WiFly module to join the network indicated by . If the network has security enabled, you must first set the pass phrase with the set wlan pass command prior to issuing the join command. NOTE: The must not contain spaces. If the network SSID contains spaces, use a $ instead of the space, e.g., MY$NETWORK to represent My Network.
RN -W IFLYCR -U M open
This command opens a TCP connection to , where is the port number and is an IP address in the form ... with being a number between 0 and 255. If you do not use the and parameters, the module attempts to connect to the stored remote host IP address and remote port number. can also be a DNS host name that the module attempts to resolve.RN -W IFLYCR -U M scan This command performs an active probe scan of access points on all 13 channels, where is an optional parameter representing the time in ms per channel. represents the optional parameter P, which causes the module to perform a passive scan, and list all access points it can see in passive mode. When you use this command, the module returns the MAC address, signal strength, SSID name, and security mode of the access points it finds.
RN -W IFLYCR -U M save This command saves the your configuration settings to a file, where is an optional filename. If you do not specify a filename, the module saves the settings to a file named config (default). Default: config Example: save save my_config // Saves the configuration settings to the config file // Saves the settings to the my_config file boot image This command makes a file represented by the new boot image.
RN -W IFLYCR -U M ADVANCED FEATURES & SETTINGS This chapter describes the WiFly module’s advanced features, including techniques to put the module to sleep, wake up, and methods to open a TCP connection when awake. It also describes the UART flow control, alternative GPIO functions, and the real-time clock. ACCESS POINT (AP) MODE Roving Networks WiFly modules support several methods for accessing Wi-Fi networks. In addition to infrastructure mode and ad hoc mode, with firmware version 2.
RN -W IFLYCR -U M Enabling AP mode There are two methods for enabling AP mode, hardware and software, as described in the following sections. Enable in Hardware To enable AP mode in hardware, hold GPIO9 high at 3.3 V and then reboot (or power cycle) the module. The module boots up in AP mode with the DHCP server enabled. NOTE: Refer to the documentation for your module on the Support page of the Roving Networks web site at http://rovingnetworks.
RN -W IFLYCR -U M Using AP Mode The following sections describes how to use AP mode, including connecting to the module, checking for the last device connected over TCP, viewing associated devices, enabling the link monitor, and routing data between clients. Connect to the Module Once the module boots up in AP mode, any client device can associate with the network the module is broadcasting. Once associated, the module’s DHCP server assigns an IP address to the client device.
RN -W IFLYCR -U M View Associated Devices To see a list of devices associated with the module, use the show associated command. The command output is in the following format with commas delimiting the fields: Connection number Host MAC address Received byte count Transmitted byte count Seconds since last packet received Figure 8 shows example output from the show associated command. Figure 8. Show Associate Command Example Output <2.
RN -W IFLYCR -U M Table 16. GPIO Alternative Functions GPIO Description GPIO Role in alternative function GPIO4 High when the first client associates, Low when all clients leave the network GPIO5 WiFly module can drive it high to open a TCP connection to a stored host.
RN -W IFLYCR -U M When the module wakes up from sleep, it takes time (in milliseconds) to initialize the internal hardware. During this time, any data that is sent to the WiFly module over the UART is not processed. You can monitor signals that indicate the module is ready to accept data, as described in Table 19. Table 19. Signals Indicating the Module Can Accept Data Method Interface Description RTS transition RTS pin When the WiFly module wakes up, the RTS pin goes high.
RN -W IFLYCR -U M SYSTEM & AUTO-CONNECT TIMERS The WiFly module uses a real-time clock (RTC) to generate timers. The RTC is active even when the module is asleep, allowing you to put the module to sleep and wake it based on timer intervals. The module has the following timers: • Sleep timer—Used to put the module to sleep. It is a 32-bit number, which corresponds to a maximum 1.19 million waking hours.
RN -W IFLYCR -U M For example, if you want a UDP sleep timer of 40 ms, use the following commands: set sys autosleep 4 set comm timer 10 // Set the auto-sleep value to 4 // Set the comm timer to 10 ms (default value) The resulting UDP sleep timer is 4 x 10 ms or 40 ms. You could also set autosleep = 2 and comm timer = 20 ms to achieve the same effect. Roving Networks recommends using a minimum value of 2 (when the default flush time is 10 ms) to ensure that the UDP packet is transmitted.
RN -W IFLYCR -U M Table 21. Sensor Input Values Wake on Sensor Input Value Command 0 1 set sys trigger 1 1 2 set sys trigger 2 2 4 set sys trigger 4 3 8 set sys trigger 8 WARNING: The voltage on any sensor input CANNOT exceed 1.2-V DC or the module will be permanently damaged. The sensor inputs are rated 1.2-V DC, maximum. You must use a resistor divider when driving a sensor pin from the other 3-V pins such as RX.
RN -W IFLYCR -U M fragmentation. For high throughput, increase the UART baud rate, set the flush size to 1,460, and set the flush timer to a large value so that full IP packets are sent. You can control packet forwarding in the following ways: • set comm match sets the value of the packet terminator. Each time the module sees the match character it sends an IP packet. For example, set comm match 0xd forwards a packet when the module sees a 0xd hex character.
RN -W IFLYCR -U M NOTE: To set the GPIO pins as inputs or outputs instantly, use the set sys mask 0xABCD 1 command, which does not require a reboot. The RN-134 evaluation board’s LEDs are connected to GPIO4 - 6. To disable the LEDs, enable the alternative functions of the LEDs (use the set sys iofunc 0x7 command). NOTE: You can turn off the yellow, red, or green LEDs. The RN-134 board’s blue LED is the power indicator and cannot be turned off.
RN -W IFLYCR -U M Table 22. GPIO Pin Usage, Default State & Functionality Bit Signal Name RN-131 Default State RN-171 Default State 0 GPIO0 N/A N/A - 1 GPIO1 N/A Input Unused. 2 GPIO2 N/A Input Unused. 3 GPIO3 N/A Input Unused. 4 GPIO4 Output Output Green LED. 5 GPIO5 Output Output Yellow LED. 6 GPIO6 Output Output Red LED. 7 GPIO7 Output Output Blue LED. 8 GPIO8 Input Output Unused. 9 GPIO9 Input Input 10 GPIO10 Output Output UART TX.
RN -W IFLYCR -U M Table 23. GPIO Pin Alternate Function Bitmask Bit Signal Name Direction Function 0 GPIO4 Output Disable the LED function so the I/O can be used as a GPIO pin. 1 GPIO5 Output Disable the LED function so the I/O can be used as a GPIO pin. 2 GPIO6 Output Disable the LED function so the I/O can be used as a GPIO pin. 3 Unused - 4 GPIO4 Output 5 GPIO5 Input 6 GPIO6 Output This pin goes high after the module has associated/authenticated and has an IP address.
RN -W IFLYCR -U M Figure 11. Controlling Connections with the GPIO Pins Embedded Microprocessor WiFly Module This signal instructs the microprocessor that it is OK to open a TCP connection. GPIO4 = High by WiFly Module Event: The WiFly module is associated with an access point and has a valid IP address. Event: the microprocessor wants to open a TCP connection to the stored remote host.
RN -W IFLYCR -U M SETTING DEBUG PRINT LEVELS You can enable print functions to assist with debugging the operation and status of the module. The set sys printlvl command controls these additional print functions, where is a bit-mapped register that controls which printout messages are sent to the UART. See “set sys printlvl ” on page 22 for more information. Scan Output Format You enable the scan output using the set sys printlvl 0x4000 command.
RN -W IFLYCR -U M Table 24. Security Modes Number Description 0 OPEN 1 WEP (64 or 128 ) 2 WPA1 3 MIXED 4 WPA2 5 Enterprise WEP 6 Enterprise WPA1 7 Enterprise WPA mixed 8 Enterprise WPA2 9 Enterprise NO security Table 25 describes the capabilities bit mask values. Table 25.
RN -W IFLYCR -U M Firmware Version 2.22 through 2.30 Firmware version 2.22 through 2.30 supports a comma-delimited scan output format, which a microprocessor can use to parse the RSSI information.
RN -W IFLYCR -U M USING THE REAL-TIME CLOCK FUNCTION The module’s real-time clock keeps track of the number of seconds since the module was powered on and the actual time when the module synchronized with the sNTP time server. By default, the module keeps track of up time but does not synchronize with the time server because this synchronization requires the module to be associated with a network that can access the sNTP server.
RN -W IFLYCR -U M TIME STAMPING PACKETS You can use the time stamping feature to append 8 bytes to a TCP or UDP packet automatically. The set ip flags 0x87 command enables the time stamp and keeps other default settings). The time stamp bits from MSB to LSB are: User’s TCP or UDP packet data 63..56 55..48 47..40 39..32 31..24 23..16 15..8 7..0 The 8 bytes represents the 64-bit raw value of the real-time clock register.
RN -W IFLYCR -U M ADVANCED APPLICATIONS This section describes a variety of advanced applications for the WiFly module, such as sending data using UDP, associating with access points, using the HTML client feature, upgrading the firmware over FTP, etc. SENDING DATA USING UDP UDP is a connectionless protocol: there is no initial handshaking between the hosts to set up the UDP connection and the receiver does not send an acknowledgement when it receives UDP packets.
RN -W IFLYCR -U M UDP Auto Pairing With the UDP auto-pairing feature, the module temporarily stores the host IP address of the first remote device that sends a UDP packet to the module. This host IP address is stored in the module’s RAM, which is cleared when the module sleeps or power cycles. This feature allows the module to echo to any client that sends a UDP packet. Example: Turn on Auto Pairing set ip host 0.0.0.0 set ip flags 0x40 // Set the host to 0.0.0.
RN -W IFLYCR -U M Figure 12. UDP Broadcast Packet Byte Format Position 0 - 5 6 7 8 - 9 10 - 13 14 - 15 16 - 17 18 - 31 32 - 59 60 - 91 92 - 93 94 - 110 Access Point’s MAC Address (6 Bytes) Channel (1 Byte) RSSI (1 Byte) Local TCP Port (2 Bytes) RTC Value, MSB to LSB (4 Bytes) Pin 20’s Battery Voltage in mV, e.g.
RN -W IFLYCR -U M Figure 14. Find Available Networks If you are connecting to an open network, use the join command to associate with the access point. The scan list in Figure 14 shows that roving1 is an open access point. Type join roving1 (or join # 1) to associate with the network as shown in Figure 15. Figure 15. Join the Network If the access point is secure, you must set the pass phrase prior to issuing the join command.
RN -W IFLYCR -U M In your COM port redirector program, note your computer’s IP address, e.g., by typing the ipconfig command in the Microsoft Command Window. Go to your terminal emulator and put the module into command mode. Type the open
command. The server reports that the connection is open and you can type characters into the UART window and see them on the server window or vice versa.RN -W IFLYCR -U M Using DNS Settings The module contains a built-in DNS client. If you do not specify the host’s IP address, (i.e., it is set to 0.0.0.0), the module uses DNS protocol. When you set the host name using the set dns name command, the module automatically attempts to resolve the host address. When the address is resolved, the module connects automatically. To manually look up a host’s IP address, use the lookup command, where is the hostname.
RN -W IFLYCR -U M To make the connection, use the open command or you can use open www.webserver.com 80. The user’s microprocessor writes the following string to the UART: GET /ob.php?obvar=WEATHER \n\n Where the \n is the linefeed character (decimal 10 or hex 0xa). Two linefeeds are required for the web server to know the page is complete. NOTE: Some web servers require a carriage return and linefeed to indication the page is complete. In this case, use \r\n at the end of the string instead of \n\n.
RN -W IFLYCR -U M NOTE: If the HTML header contains spaces, you must use the $ character to indicate spaces in the string. (A space is the command delimiter.) When the module’s command parser sees the $, it converts it to a space character. Example: Connect to Web Server Every 30 Seconds Use the following commands to configure the module to connect to a web server every 30 seconds: set set set set com remote GET$/ob.
RN -W IFLYCR -U M Post Sensor Data Automatically The module can send the value of the GPIO and sensor pins to the web server automatically. The data arrives as 18 bytes of ASCII hex data in the format <2 bytes GPIO>. NOTE: The analog-to-digital convertor is 14 bits on a 400 mV signal, which translates to about 24 microvolts (0x61A80 in hex). When you use the show q command in command mode, the module displays the raw readings.
RN -W IFLYCR -U M After issuing these commands, the web server returns a 200 OK message, as shown in Figure 16. Figure 16. Server Response You can view the data you sent to the Roving Networks web server at http://rovingnetworks.com/wiflys/view. HTML Client Example: Posting UART Data to a Web server The module can post serial UART data in ASCII or binary format automatically.
RN -W IFLYCR -U M With these settings enabled, the module connects to the web server every time it receives data on the RX line. Serial data is sent to the host web server according to the flush timer and the flush size. NOTE: You cannot append the sampled sensor data to the UART data. Enabling option format 7 with set uart mode 2 results in erroneous data. You can view the data you sent to the Roving Networks web server at http://rovingnetworks.com/wiflys/view.
RN -W IFLYCR -U M The previous firmware becomes the backup image. The following example shows the file system after a successful update: FL# SIZ FLAGS 11 18 3 29 1 10 30 18 3 208 Free, Boot=30, Backup=11 WiFly_GSX-2.20 config WiFly_GSX-2.21 After downloading, the firmware checks the image and compares it to the stored values in the file before committing the image to flash and updating the boot record. If the checksum fails, the module displays UPDATE FAILED=x and deletes the image.
RN -W IFLYCR -U M the name and prints the open string on the UART. By default, the open string is *OPEN*. After you see *OPEN* on the UART, you can begin writing data in to the file. There are two options to close the file: • Send the close string, which is *CLOS* by default. • Use the FTP close timer with the command set ftp timer . Once you finish writing to the file, this timer begins counting down and closes the file when the timer gets to zero.
RN -W IFLYCR -U M Figure 17. Push-Button WPS The module supports the WPS feature in firmware version 2.28 and higher. To upgrade to the current firmware version and download the WPS application, refer to the WPS application note on the Support page of the Roving Networks web site at http://www.rovingnetworks.com/Support_Overview. NOTE: Modules that ship with firmware version 2.28 or higher already have the WPS application.
RN -W IFLYCR -U M Launching a WPS Application There are two ways to invoke a WPS function: • Using the wps command in the console. • Using the ad hoc/factory reset pin (GPIO9). To invoke a WPS function using the ad hoc/factory reset mode: 1. Enable the WPS function on GPIO9 using the set system trigger 0x10 command. WPS on GPIO9 is disabled by default to avoid accidentally invoking the WPS function. 2. The WPS application is invoked when GPIO9 goes from low to high.
RN -W IFLYCR -U M Figure 19. Access Points Supporting WPS in Scan List If you press the WPS button on the access point and then perform a scan, the scan returns a –A to indicate the access point is in WPS active mode. See Figure 20. Figure 20. Scan Showing Access Points in WPS Active Mode www.rovingnetworks.com Version 1.
RN -W IFLYCR -U M AD HOC NETWORKING MODE There are two types of networks, infrastructure and ad hoc. Infrastructure networks, in which an access point links all Wi-Fi devices, are the most common. The access point keeps track of devices on the local network and directs IP packets. In many cases, the access point is also a router and forwards packets from the local network to other networks and the Internet.
RN -W IFLYCR -U M Turn off DHCP so that the module does not attempt to obtain an IP address from another device, and set the module’s IP address and netmask. Because automatic IP assignment fixes the first two bytes of the IP address, use 255.255.0.0 as the netmask so that other devices connecting to the module can be reached. You can also set the netmask to a smaller subnet if the other device’s IP addresses begin statically at the same subnet as the ad hoc device. set ip address 169.254.1.
RN -W IFLYCR -U M ANALOG SENSOR CAPABILITY The module has 8 analog sensor inputs that can be driven between 0 to 1.2-V DC. You can sample the analog inputs and read digital value using the show q command, where is a decimal number representing the channel. See “show q ” on page 36 for more details. WARNING: Driving these inputs above 1.2 V can permanently damage the module. The channel is the analog sensor input from 0 to 7.
RN -W IFLYCR -U M Using the Built-In Sensor Power The modules contain an on-board sensor power pin, which is controlled by the set q sensor command. is a bit mask value that determines which sensor pins to sample when sending data using the UDP broadcast packet or the HTTP auto-sample function. See “set q sensor ” on page 19 for more details. NOTE: In versions of firmware prior to 2.23, this command is named set option sensor. Firmware versions 2.
RN -W IFLYCR -U M DEFAULT CONFIGURATION This section describes the default configuration settings and how to restore them. ADHOC PARAMETERS Beacon Probe Reboot 100 (milliseconds) for ad hoc mode only 5 (seconds to look for beacons before declaring ad hoc is lost) for ad hoc mode only 0 (unused parameter for future development. Leave at default value.) BROADCAST PARAMETERS IP address Port Interval 255.255.255.
RN -W IFLYCR -U M Timeout FTP_mode 200 0x0 IP PARAMETERS DHCP IP address Net mask Local port Gateway Host Remote port Protocol MTU Flags TCP mode Backup ON (1 = enabled) 0.0.0.0 255.255.255.0 2000 0.0.0.0 0.0.0.0 2000 2 (TCP server and client) 1524 0x7 0x0 0.0.0.
RN -W IFLYCR -U M UART PARAMETERS Baudrate Flow Mode Cmd_GPIO 9600 0 (disabled) 0 0 WLAN PARAMETERS SSID Channel External antenna Join mode roving1 0 (Automatic scan) 0 (Off - use on-board chip antenna for RN-131 ONLY) 1 (Automatically scan and join based on SSID) for firmware version 2.36 (ad hoc mode) and lower 0 for firmware version 2.45 (soft AP mode) and higher OPEN 0x1FFF (All channels) 12 (24 Mbit) 0 rubygirl 0 (which implies 12 dBm.
RN -W IFLYCR -U M RESTORING DEFAULT CONFIGURATION SETTINGS You can restore the default factory configuration settings in software and hardware. • Software—In command mode, use the factory RESET command to restore the defaults. This command automatically loads the default settings and executes a save command. Next, send the reboot command so that the module reboots with the default configuration. • Hardware—Set GPIO9 high on power up to arm the factory reset function.
RN -W IFLYCR -U M BOOT-UP TIMING VALUES Table 31 shows the boot-up timing values. Table 31. Boot-Up Timing Values Function Description Time (ms) Power up Power up time from reset high or power good to boot code loaded. 70 Initialization Initialize ECOS. 50 Ready Load configuration and Initialize application 30 Join Associate using channel = 0 (full channel scan, mask = 0x1FFF). 80 Associate using channel = 0 (primary channel scan, mask = 0x421).
RN -W IFLYCR -U M SUPPORTED ACCESS POINTS The module should work with any standard access point.
RN -W IFLYCR -U M COMMAND LIST Tables 32 through 36 provide a listing of all available commands and their defaults. For more detailed information refer to “Command Reference” on page 5. Table 32. Set Command List Command Default Description set adhoc beacon 100 Sets the ad hoc beacon interval in milliseconds. set adhoc probe 5 Sets the ad hoc probe timeout in seconds. set broadcast address 255.255.255.
RN -W IFLYCR -U M Command Default Description set ip gateway
0.0.0.0 Sets the gateway IP address. set ip host 0.0.0.0 Sets the remote host’s IP address. set ip localport 2000 Sets the local port number. set ip netmask 255.255.255.0 Sets the network mask. set ip protocol 2 Sets the IP protocol. set ip remote 2000 Sets the remote host port number.RN -W IFLYCR -U M Command Default Description set wlan auth 0 Sets the authentication mode. set wlan channel 0 Sets the WLAN channel, where is a decimal number from 1 to 13 representing a fixed channel and is the optional character i (meaning immediate). set wlan ext_antenna 0 Determines which antenna is active, where is 0 (use the chip antenna) or 1 (use the U.FL connector).
RN -W IFLYCR -U M Table 34. Status Commands Command Description show battery Displays current battery voltage, and is only applicable to Roving Networks’ battery-powered products such as the RN-370 and temperature sensors (ISENSOR-CB). show connection Displays the connection status in the hex format 8. show io Displays the GPIO pins’ level status in the hex format 8. show net Displays the current network status, association, authentication, etc.
RN -W IFLYCR -U M Table 36. File I/O Commands Command Description del Deletes a file. load Reads in a new configuration file. ls Displays the files in the system. save Saves the your configuration settings to a file. boot image Makes a file represented by the new boot image. ftp update Deletes the backup image file, retrieves a new image file, and updates the boot pointer to the new image. www.rovingnetworks.com Version 1.
RN -W IFLYCR -U M KNOWN PROBLEMS The firmware has the following known issues: • Flow control—RTS may fail to de-assert quickly enough for some high-speed CPUs to stop sending data bytes correctly. For high-speed transfers at baud rates greater than 460,800, Roving Networks recommends limiting the RX data to the maximum Ethernet frame (1,460 bytes) and using a protocol to acknowledge that the remote host receives the data. www.rovingnetworks.com Version 1.
RN -W IFLYCR -U M CURRENT FIRMWARE FEATURES & FIXES VERSION 2.36/2.45 9/14/2012 • Firmware versions 2.36 and 2.45 are being shipped together. Version 2.36 supports ad hoc mode, while version 2.45 supports soft AP mode. All modules shipped with these firmware versions will run version 2.36 by default to maintain backward compatibility with previous firmware versions. You can change the firmware image using the boot image command.
RN -W IFLYCR -U M VERSION 2.30 10/26/2011 • Added support for incorrect WPA modes, namely WAPv1 with AES encryption and WPAv2 with TKIP encryption. • Added support for WEP shared mode • Increased FTP filename size to 64 bytes • Added a new reboot register in ad hoc parameters. This register is reserved for future development and should not be used. Please leave it to default values. • Added a new debug register in the system parameters.
RN -W IFLYCR -U M • Fixed a bug in the set uart instant command wherein the WiFly module would not return an AOK over telnet. Now when this command is issued, it returns an AOK over telnet and does not exit command mode. • Enabled scanning for wireless networks remotely when in ad hoc mode. When the scan command is issued, ad hoc is temporarily disabled and results of the scan are sent over telnet. • The behavior of the auto connect timer has changed.
RN -W IFLYCR -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.