Arduino Uno + Wifly RN-XV (Not the shield)

After many hours of searching the web, and finding some other people with the same basic problem, I thought I’d share what I found about getting this combination to work using the basic serial communication method. (VCC, GND, DOUT, DIN).

I’m still pretty new to all this, so just hoping this can help someone else out.

Components

  • - Arduino Uno [http://www.sparkfun.com/products/11021](http://www.sparkfun.com/products/11021)
  • - Wifly RN-XV [http://www.sparkfun.com/products/10822](http://www.sparkfun.com/products/10822)
  • - XBee Breakout [http://www.sparkfun.com/products/8276](http://www.sparkfun.com/products/8276)
  • Note, that’s just the plain breakout board. I tried the regulated board and I could not get it to work.

    The problem I had was trying to communicate with my arduino uno and the wifly at the same time. I just could not get my sketches to work and output info to the serial monitor at the same time as I had the wifly connected.

    Thanks to a couple of sites I found a solution. That solution was to let the serial monitor communications use the stand rx/tx pins 0/1 and to configure the arduino to access the wifly on pins 2 and 3.

    I used Tom Waldocks WiFly Serial code http://sourceforge.net/projects/arduinowifly/files/ to get this working. Also helpful was the Cairo Hackerspace blog http://cairohackerspace.blogspot.com/20 … g-and.html. All of their info was great, but the single line of code I found that pulled it all together was at http://niltoid.blogspot.com/2012/02/rn-xv-wifly.html.

    That little line of code was “WiFly.setUart”. And bingo! I was able to connect and get things working.

    I can’t tell you how many hours I futzed around with this with my sketches never getting past the ‘WiFly.begin();’ line. I was convinced it was damaged somehow and came close to chucking the whole thing.

    But now that stumbling block has been removed and I can continue on.

    So a hearty thanks to the people that put their findings out there so I could find it and get things working!

    // (Based on Ethernet's WebClient Example)
    #include "WiFly.h"
    #include "Credentials.h"
    #include <SoftwareSerial.h>
    SoftwareSerial SerialRNXV(2, 3);
    
    byte server[] = { 74, 125, 224, 50}; // Google
    
    //Client client(server, 80);
    
    WiFlyClient client("google.com", 80);
    
    void setup() {
      Serial.begin(9600);
      SerialRNXV.begin(9600);
     
      WiFly.setUart(&SerialRNXV);
      Serial.println("begin");
      WiFly.begin();
      Serial.println("began");
      
       //if (!WiFly.join(ssid, passphrase, WEP_MODE)) {
       if (!WiFly.join(ssid
       )) {
    
         Serial.println("Association failed.");
        while (1) {
          // Hang on failure.
        }
      }  
    
      Serial.println("connecting...");
    
      if (client.connect()) {
        Serial.println("connected");
        client.println("GET /search?q=arduino HTTP/1.0");
        client.println();
      } else {
        Serial.println("connection failed");
      }
      
    }
    
    void loop() {
      if (client.available()) {
        char c = client.read();
        Serial.print(c);
      }
      
      if (!client.connected()) {
        Serial.println();
        Serial.println("disconnecting.");
        client.stop();
        for(;;)
          ;
      }
    }
    

    http://farm8.staticflickr.com/7042/6983 … 2d67_m.jpg

    http://farm8.staticflickr.com/7176/6983 … d6d8_m.jpg

    Abara cadabra,

    hocus pocus,

    WiFly.setUart().

    …magic.

    How were you able to connect an RN-XV with 3.3v logic to a 5v Uno without a logic level converter? It should have fried the RN-XV, please teach me this witchery!

    Hey man I use the arduino Uno + Wifly RN-XV + arduino Wireless proto shield.

    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’t setup infrasturce mode manually by sending commands in putty but not using the coding on Arduino 1.0 IDE.

    2. My Wifly 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?

    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

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

    I want to try your analogy with the pins but my RN-XV is not fitting in the breadboard and I don’t have any Breakout Board for XBee Module…

    Do you have it wired correctly?

    By default, the wireless shield has the wifly connected to the arduino via hardware serial. If you want to debug using serial then you need to bend away pins 1 and 2 on the shield so they don’t connect to the arduino and then run jumpers on the shield from pins 1 and 2 to other pins (6 and 7) that you setup a software serial port to use and talk to the wifly since hardware serial is using pins 1 and 2.

    varuninnz:
    Hey man I use the arduino Uno + Wifly RN-XV + arduino Wireless proto shield.

    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’t setup infrasturce mode manually by sending commands in putty but not using the coding on Arduino 1.0 IDE.

    2. My Wifly 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?

    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

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

    I want to try your analogy with the pins but my RN-XV is not fitting in the breadboard and I don’t have any Breakout Board for XBee Module…

    Hi KingBubbaTruck

    Thanks for the post. It is really help me to understand WiFly more.

    I copied your code and paste it. When I verify the code, error was found.

    I installed the library from the place as stated in the http://niltoid.blogspot.com/2012/02/rn-xv-wifly.html.

    Where am I wrong? I am sure I save the library at the correct folder. I even opened the example code and verify it with no error.

    Is it working code and tested?

    Regards

    aaronbear:
    How were you able to connect an RN-XV with 3.3v logic to a 5v Uno without a logic level converter? It should have fried the RN-XV, please teach me this witchery!

    Does anyone have an answer for that?

    andrelcm:

    aaronbear:
    How were you able to connect an RN-XV with 3.3v logic to a 5v Uno without a logic level converter? It should have fried the RN-XV, please teach me this witchery!

    Does anyone have an answer for that?

    There is a 3.3v regulator onboard as well with an output next to the 5v on the power header.

    WonderSlug:

    andrelcm:

    aaronbear:
    How were you able to connect an RN-XV with 3.3v logic to a 5v Uno without a logic level converter? It should have fried the RN-XV, please teach me this witchery!

    Does anyone have an answer for that?

    There is a 3.3v regulator onboard as well with an output next to the 5v on the power header.

    I understand the 3V3 pin output on arduino connected to it. What I cannot undertand is the digital pins of arduino connect directly to TX/RX on RN-XV.

    Can’t say for certain, but these to links lead me to believe logic conversion is not necessary:

    http://www.sparkfun.com/tutorials/225

    http://dlnmh9ip6v2uc.cloudfront.net/dat … -XV-DS.pdf

    Hi,

    I have the same problem. I think that the first is to clear what does the specification refers about.

    Datasheet on RN-171 says that the pin are 3.3V tolerant. I think this is very clear (http://www.rovingnetworks.com/products/RN171 see datasheet at page 7)

    Datasheet on RN-XV (which is the development board that contains the RN-171 module) says something different. It says UART TTL. In my language UART TTL is 0-5V capable otherwise if it was LVTTL (low voltage TTL) then I would understand 0-3.3V. About TTL levels you can see this link: http://digital.ni.com/public.nsf/allkb/ … FB0067A4BD. As you can see, by specification the important thing is that a high level bit is between 2V and 5V.

    Looking in deep the RN-XV board, I’ve noticed that on the pin number 2 (RX) there is a voltage divider with R1 470K and R2 100K. This means that in the center of the divider, considering that a level of 5V is expected at the dev board RX input, a 0.877V should be present in case of high level. This seems very strange because as of TTL standard it is in the undeterminate range, and also if you make the same calculation with 3.3V then you obtain a 0.578V which is under the minimum expected values. However, maybe that the board is multilayer and a face is covered by the RN-171 module, so maybe that other components are hidden. The voltage divider is also shown in the RN-XV datasheet. This is a bit confusing, since by my experimentals:

    If I put an external voltage divider in front of the input to put 3.3V the module does not work. If I remove them it works.

    My RN-XV is rev.3 from Roving Networks (the red one) with 2.32 firmware on board.

    Is there here a wizard that can explain me what is happening?

    Thanks

    Paolo