Pages: 1 [2]   Go Down
Author Topic: Trouble using Wireless Shield and RN-XV  (Read 5916 times)
0 Members and 1 Guest are viewing this topic.
Wellington, New Zealand
Offline Offline
Sr. Member
****
Karma: 1
Posts: 404
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: April 11, 2012, 09:33:49 pm by dhunt » Logged


Colorado
Offline Offline
Edison Member
*
Karma: 47
Posts: 1562
Reviving dead brain cells with Arduinos.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Wellington, New Zealand
Offline Offline
Sr. Member
****
Karma: 1
Posts: 404
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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:
void loop()
{
    wifly.terminal();
}

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.

dhunt,

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:
#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.begin(115200);
    Serial.println(F("Starting"));
    Serial.print(F("Free memory: "));
    Serial.println(wifly.getFreeMemory(),DEC);

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

    /* Join wifi network if not already associated */
    if (!wifly.isAssociated()) {
/* Setup the WiFly to connect to a wifi network */
Serial.println(F("Joining network"));
wifly.setSSID(mySSID);
wifly.setPassphrase(myPassword);
wifly.enableDHCP();
wifly.save();

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

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

    //wifly.terminal();

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

    wifly.setDeviceID("Wifly-WebServer");

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

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

void loop()
{
    wifly.terminal();
}
Logged

Pages: 1 [2]   Go Up
Jump to: