Roving Networks WiFly RN-171-XV

Roving Networks (acquired by Microchip Technology) WiFly RN-171-XV is 802.11 b/g solution especially designed for customer who want to migrate their existing 802.15.4 architecture to a more standard TCP/IP based platform.

Hello World

Import programWebsocket_Wifly_HelloWorld

WebSocket Hello World using the wifly interface


Import libraryWiflyInterface

mbed official WiflyInterface (interface for Roving Networks Wifly modules)





mbed pinRN-171-XV pin
VDD1 - VDD_3V3
p102 - TXD
p93 - RXD
p305 - RESET_N
p2915 - GPIO6/SEN7


  • Direct internet connectivity provides internet access to every node
  • Point to point connectivity to every node without the need for custom profiles
  • Based on common 802.15.4 footprint
  • 3 Antenna options available - wire, reverse polarity SMA connector, and U.FL connector
  • Ultra low power: 4uA sleep mode, 38mA active
  • Onboard TCP/IP stack includes DHCP, UDP, DNS, ARP, ICMP, HTTP client, FTP client and TCP
  • Firmware configurable transmit power: 0dBm to 12dBm
  • Hardware interfaces: TTL UART
  • Host data rate up to 464Kbps over UART
  • Supports Adhoc and infrastructure networking
  • 8 general purpose digital I/O
  • 3 analog sensor inputs
  • Real-time clock for time-stamping, auto-sleep, and auto-wakeup modes
  • Accepts 3.3VDC regulated power supply
  • Configuration over UART or wireless interface (via Telnet) using simple ASCII commands
  • Over the air firmware upgrade (FTP)
  • Secure Wi-Fi authentication: WEP, WPA-TKIP , WPA2-AES


Device Won't connect to WiFi but you're sure the settings are correct

For me this fixed the problem being that I was 1000% certain that the ssid and phrase were correct and I always got:

<4.00> join
Auto-Assoc McGroves chan=0 mode=NONE FAILED


Auto-Assoc McGroves chan=1 mode=MIXED SCAN OK
<4.00> Joining McGroves now..
Disconn from McGroves,AUTH-ERR
AP mode as McGroves on chan 1
DCHP Server Init

From either of these states you can see the result from scan:

<4.00> scan
SCAN:Found 0
SCAN:Found 6

Try this:


You will have to change the wifi pinnames to match the tx and rx pins as routed for your specific hardware. Also, make sure to update the mbed SDK library to ensure you have platform support.

Import programWifly_configure

Configure wifly module

  1. power cycle the device
  2. send $$$
  3. send factory RESET
  4. send scan (if your device isn't here or if all 000000's are returned, there's your problem)
    • if 0 networks are returned or all the info is 0's keep sending scan until you get multiple valid networks. Then send factory RESET
    • I think the critical step is that you get valid networks upon sending the first scan. Otherwise reset the device and start again
  5. send set wlan ssid network_name
  6. send set wlan phrase password (spaces don't seem to be supported - I didn't test this but read about other peoples problems while looking for a solution here)
  7. send join
  8. send ftp update
  9. send boot image _ _ (the number of file returned from ftp update)
  10. send factory R
  11. power cycle the board

Not sure if this problem is fixed with or greater. Every device I had was 4.0.0 (problems) and once connected to a network I updated the firmware.

Firmware update

Microchip now has available firmware 4.7.5. With some initial testing, it seems to be better than the 4.0.0.

Test Program

The following test program, set up for the Application Board, boots the WiFly module, joins the network, disconnects, and repeats. If things go wrong - the WiFly module hangs, then the mbed Watchdog kicks in.

With firmware version 4.75, it has reasonably promising results.

Total Number of TestsSuccessful ConnectsSuccess (on retry)Hang - WatchDog ResetWhen
70216926 (98.7 % includes retry)78 (1.1%)17First day
3012330031 (99.6% includes retry)547 (1.8%)92Several days later

So, not 100%, but it was able to successfully recover. I had run a similar test with v4.0.0 and don't recall the results - other than substantially worse.


#include "mbed.h"
#include "WiflyInterface.h"
#include "Watchdog.h"

/* wifly object where:
*     - p9 and p10 are for the serial communication
*     - p25 is for the reset pin
*     - p26 is for the connection status
*     - "mbed" is the ssid of the network
*     - "password" is the password
*     - WPA is the security

#include "C12832.h"
C12832 disp(p5, p7, p6, p8, p11);
WiflyInterface wifly(p9, p10, p30, p29, "mbed", "password", WPA);

Watchdog wd;
extern "C" void mbed_reset();

int main() {
    uint16_t bootCount;
    uint16_t bootCheck;
    uint16_t wdCount;
    uint16_t retryCount;
    wd.Configure(60.0);                         // Set time limit for each test run
    bootCount =  (LPC_RTC->GPREG0 & 0xFFFF);    // Count boots here
    bootCheck =  (LPC_RTC->GPREG0 >> 16);       // copy of bootCount
    wdCount =    (LPC_RTC->GPREG1 >> 16);
    retryCount = (LPC_RTC->GPREG1 & 0xFFFF);

    if (bootCheck != bootCount) {
        bootCount = 1;
        wdCount = 0;
        retryCount = 0;
    } else {
    bootCheck = bootCount;
    LPC_RTC->GPREG0 = ((uint32_t)bootCheck << 16) | bootCount;
    if (wd.WatchdogCausedReset()) {
        wdCount++;  // Count Watchdog events here
        LPC_RTC->GPREG1 = (wdCount << 16) | retryCount;
    // Wifly: 12345 boots, 1234 WD
    // 1234 retries
    // IP: Disc. OK.
    disp.printf("Wifly:%5d boots, %3d retry     %4d WD ", 
        bootCount, retryCount, wdCount);
    wifly.init(); // use DHCP
    disp.printf("Con- ");
    while (0 != wifly.connect()) {
        LPC_RTC->GPREG1 = (wdCount << 16) | retryCount;
        disp.printf("retry- ");
    disp.printf("IP: %s. ", wifly.getIPAddress());    
    disp.printf("Disc. ");
    mbed_reset();                           // reset here indicates successful communication