arduino and rn171 communication issue.

first apologies for cross posting, I have posted this to microchip forum also.
I am having RN-171 module which i used to connect to Arduino due and it was working fine till two days earlier. I am using wiflyhq library and softwareserial library to communicate between arduino and rn171 on pins 2,3 in arduino. suddenly I was unable to receive any data from arduino to my windows 7 machine. After debugging the arduino sketch i found that softwareserial begin() is not taking off. So I thought it was arduino which has become faulty and first changed with a spare atmega168 on the same borad, result is same, so now i changed to a new board itself again same result , and then i bought a uno hoping that it will work, but result it same, so i disconnected rn171 and arduino and checked arduino individually , which is working great with other sketches like blink etc. so i started to check with rn171 module which responds properly to all the commands over the air as well as over comm port still, i made a factory reset and again made necessary changes to associate with my wifi , and tested again worked well, so again i connected to the arduino uno and uploaded the wiflyhq sample sktech tcpclient , upload successful but once again the result is same, but now i noticed that the tx led on arduino blinks continously and the serial debugger of arduino continuously runs the test message which is strange because the test code is in setup section not in loop section. And again the i noticed that softwareserial is not begining. Now I don’t know what to do and what i have done , for ref the sample sketch is

#include <SoftwareSerial.h>
SoftwareSerial wifiSerial(8,9);

//#include <AltSoftSerial.h>
//AltSoftSerial wifiSerial(8,9);

#include <WiFlyHQ.h>

/* Change these to match your WiFi network */
const char mySSID[] = "myssid";
const char myPassword[] = "my-wpa-password";

void terminal();

WiFly wifly;

void setup()
    char buf[64];

    Serial.print("Free memory: ");

    if (!wifly.begin(&wifiSerial, &Serial)) {
        Serial.println("Failed to start wifly");

    /* Join wifi network if not already associated */
    if (!wifly.isAssociated()) {
 /* Setup the WiFly to connect to a wifi network */
 Serial.println("Joining network");

 if (wifly.join()) {
     Serial.println("Joined wifi network");
 } else {
     Serial.println("Failed to join wifi network");
    } else {
        Serial.println("Already joined network");

    Serial.println("WiFly ready");

    Serial.print("MAC: ");
    Serial.println(wifly.getMAC(buf, sizeof(buf)));
    Serial.print("IP: ");
    Serial.println(wifly.getIP(buf, sizeof(buf)));
    Serial.print("Netmask: ");
    Serial.println(wifly.getNetmask(buf, sizeof(buf)));
    Serial.print("Gateway: ");
    Serial.println(wifly.getGateway(buf, sizeof(buf)));

    Serial.println("Set DeviceID");
    Serial.print("DeviceID: ");
    Serial.println(wifly.getDeviceID(buf, sizeof(buf)));


    if (wifly.isConnected()) {
        Serial.println("Old connection active. Closing");

void loop()

void terminal()
    while (1) {
 if (wifly.available() > 0) {

 if (Serial.available()) { // Outgoing data

Thanks for your support and time.