RN-XV 171 + Arduino UNO + Arduino Wireless Proto Shield

Hi People

I’ve been trying to get this RN-XV 171 working for the past month now. My final year project is due in 2 weeks and Im freaking out.

My main purpose of using the RN-XV is, so my device can connect wirelessly and send emails (as urgent notifications), without using any computer (only connection with the router VIA smtp). The wifly library has many simple examples that i’ve stripped code off to construct a code that can be used to send emails. However the library is not working.

My 2 problems are:

  1. I can setup infrasturce mode manually by sending commands in putty but not using the coding on Arduino 1.0 IDE.

  2. The Wifly Alpha 2.0 Library doesn’t work. I tired uploading the wireless auto terminal example but it gets stuck at

WiFly Shield Terminal Routine (and nothing happens)

Is this because I’m using an Arduino Wireless proto shield?

So basically I can get the infrastructure mode working. When I manually program from putty with commands:

$$$

CMD

set wlan ssid <myrouter’sSSID>

set wlan phrase <myrouter’sphrase>

join myrouter’sSSID

But when I send commands by serial from arduino IDE. I dont any CMD after $$$ sign or . I’ve checked this manually on putty after uploading the program from my IDE

$$$

set wlan ssid <myrouter’sSSID>

set wlan phrase <myrouter’sphrase>

join myrouter’sSSID

I really don’t understand what I’m doing wrong and why atleast the auto terminal example is not working. Please help me out.

Most likely there are timing delays required when sending commands that were designed to be hand typed.

Check the RN-XV data sheet again then try adding delays between the commands.

In particular, you MUST NOT send a or anything else immediately after the “$$$”. Check that your program sends only the $ character three times, then waits for a suitable period. In any case, you will be battling many bugs and design flaws in both the RN-XV firmware (which is not really ready for commercial distribution) and in the Arduino software.

I’ve checked the data sheet, it doesnt talk anything about delays but I usally give a delay(500); after every command.

No my program doesn’t send any after the $$$ sign.

The design is working fine. I’ve removed the shield and tested it on a breadboard

From page 6 the WiFly data sheet: (for 250ms buffer, read “250ms required delay”) BEFORE and AFTER

NOTE: There is a 250ms buffer before and after the escape sequence. If any characters are sent before or after the escape sequence within this interval of 250ms, the WiFly module will treat it as data and pass it over the TCP or UDP socket. It will not enter command mode.

Hi There, sorry to all I made a quick type in my post. I CAN setup infrastructure mode using Putty but not from my code below. HOWEVER NOT WITH MY CODE using the Aplha 2 libraries.

#include “WiFly.h”

#include <SPI.h>

const byte server = { }; //

//Client client(server, 25);

//Client client(“”, 25);

//Client client(“”, 25); //checked from project journal. it’s correct.

WiFlyClient client(“”, 25);

const char passphrase = “”; //What is a passphrase

const char ssid = “”;

void setup() {

//lcd.begin(16, 2);

delay(1000);

Serial.begin(9600);

Serial.println(“\n\r\n\rWiFly Shield Terminal Routine”);

WiFly.begin();

if (!WiFly.join(ssid, passphrase)) {

Serial.println(“Association failed.”);

while (1) {

// Hang on failure.

}

}

Serial.println(“Associated!”);

if (client.connect()) {

Serial.println(“connected”);

}

else {

Serial.println(“connection failed”);

}

delay(1000);

// barCodeScanner.begin(DataPin, IRQpin);

delay(1000);

}

void loop(){

client.println(“helo host”);

//client.println(“auth login”);

//client.println(“password*****”);

//client.println(“password******”);

client.println("MAIL FROM: ");

/* NOT SURE IF THIS WILL WORK. TRY WITH THE ABOVE FIRST

client.print(“MAIL FROM:”);

client.println(sender_email);

client.print(“RCPT TO:”);

client.println(recipent_email);

*/

client.println("rcpt to: "); //to send a text message from vodaphone just type YourNumber@vodaphone.co.nz

client.println(“data”);

client.println(“Subject: message from wifly shield”);

/*

for (int i = 0; i<numScannedProducts; i++) {

client.println(scannedProducts*);*
}
*/

client.println(“.”);
delay(1000); // prevent multiple sends

do{
delay(1);
}
while(1>0);
}