Go Down

Topic: Trouble using Wireless Shield and RN-XV (Read 9797 times) previous topic - next topic


Apr 12, 2012, 04:28 am Last Edit: Apr 12, 2012, 04:33 am by dhunt Reason: 1
Oh good point. The sparkfun XBee shield is no good for the WiFly because the voltage level shifting solution for the rx pin does not work. That would explain why the arduino can't send anything to the WiFly. Take a look at the comments from WiFly users on that sparkfun page.

You should be able to replace the diode on the shield with a voltage divider to get it working.


Ah screw it.  I have some 2mm headers, I'll just solder wires to them and run the WiFly "bare" on that.  The shield can go back to it's dusty shelf.  Will report back later.


Lol ok.  You should still put a 5V to 3.3V voltage divider on the Rx pin to protect it from the Arduino's 5V output.  A couple of resistors will do the job (10K + 20K ?).  This site has a good write up: Savage Circuits Interfacing 5V and 3.3V devices.


It looks like the WiFly is not recieving any data from the arduino, but the arduino is recieving data from the WiFly.

Can you try a simple sketch to check the connection?

E.g try this for your loop:
Code: [Select]

void loop()

Once the terminal starts, try sending $$$ without a newline from serial monitor. The WiFly should respond with "CMD". After that you can send any of the commands from the WiFly user manual. "set uart mode 0" will turn echo back on so you can see what you are typing.

If you can't get the "CMD" response then there's something wrong with the wiring for the serial connection, or the pins being supplied to software serial.

Alright, I'll try that later this evening when I get home.  I did check all the connections and I know they're done right.  However, I do wonder if this is a similar case as using the XBEE explorer regulated where it doesn't work with it for some reason or another (I don't think anyone's actually figured out why, but I could be wrong.)  The XBEE shield (what I'm using) does have other "stuff" on it, so it's not just a straight through on the signal pins.  A lot of people suggest using the plain old XBEE breakout boards instead of of the explorer boards, so that's why I'm wondering whether this is a similar situation.

I'll let you know what happens when I do the above test.


I have put following code in my sketch as you mentioned in your post. But the arduino still is not able to communicate to RN-XV. Can you please help me out....

Code: [Select]

#include <WiFlyHQ.h>

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

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

WiFly wifly;

/* Change these to match your WiFi network */
const char mySSID[] = "XYZ";
const char myPassword[] = "abc";

char buf[80];

void setup()
    Serial.print(F("Free memory: "));

    if (!wifly.begin(&wifiSerial, &Serial)) {
        Serial.println(F("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(F("Joining network"));

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

    wifly.setBroadcastInterval(0); // Turn off UPD broadcast


    Serial.print(F("MAC: "));
    Serial.println(wifly.getMAC(buf, sizeof(buf)));
    Serial.print(F("IP: "));
    Serial.println(wifly.getIP(buf, sizeof(buf)));


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

    if (wifly.getPort() != 80) {
/* local port does not take effect until the WiFly has rebooted (2.32) */
Serial.println(F("Set port to 80, rebooting to make it work"));

void loop()

Go Up