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
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(;;)
;
}
}