Pages: [1]   Go Down
Author Topic: Can't get Wifly RN-XV into command mode  (Read 1368 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The documentation simply says to send "$$$" to the wifi module and you will get "cmd" in return telling you that you are in command mode. I'm sending "$$$" via Serial.print() but I am not getting an response. What am I doing wrong?
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 108
Posts: 5144
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The documentation says you have to send "$$$" to the module AND wait some time (as far as I remember 250ms) before that and after you've done it. Without that it will not change the mode.
Logged

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

So should I do a delay before sending "$$$" and then another delay before trying to read the response?
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 108
Posts: 5144
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
So should I do a delay before sending "$$$" and then another delay before trying to read the response?

You may use delay() to wait or some other way but you have to wait without sending anything to the module in this time. You can immediately try to read after sending the "$$$" but the module will wait with an answer until the guard time is over. If you send any character during that guard time, it will not see the "$$$" as a mode switch but as normal data.
Logged

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



Sounds like the hardware setup is all wrong. OP hasn't described how "anything" is hooked up,
but the first guess is he has the RN-XV going to the same pins as the USB port on the Arduino,
so that will never ever work. Too much guessing. I hooked up my RN-XV this morning and
typed "$$$", and got back "OK" right off. Then, I typed "get e", and it displayed the complete
setup.



Sorry, you're right, I should have added more info. I am sure it is a stupid mistake.

The module I am using is Wifly RN-XV. I have it attached to my Arduino Uno R3 on pins 8 and 9 and I am using software serial in the code. I maybe going about this all wrong. But, I am using a delay and then serial.print to send "$$$" I then am using serial.read. Is this completely wrong?

I know I am a noob. My areas of expertise lay elsewhere, but I am more than capable of learning.
Logged

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


There are a couple more issues here, and let me tell you, EVERYBODY has trouble
with these darn XBee shields. They really don't make it easy, plus many of the early
shields were poorly designed, and could blow your $40 RF modules.

First, which XBee shield are you using? They are many different ones, and all have
some serious muckups involved with using them.

Secondly, since you're doing it by sketch, you might post the code, as people often
make trivial mistakes that are easily rectified. Use the # icon to wrap the code.

Thirdly, I've never had any luck at all with SoftSerial for 2-way comms.

So, loads of gotchas with trying to get this thing to work.


I'm using this: https://www.sparkfun.com/products/10822 with this: http://www.ebay.com/itm/XBee-breakout-board-adapter-to-0-1-DIP-breadboard-/230860861800?ssPageName=ADME:L:OC:US:3160 The actual wifi chip not attached to the breakout board is wifly RN-171.

Below is my code. As you can see I am not sure where to start with this.

Code:

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


void setup()
{
  Serial.begin(9600);
  delay(500);
  Serial.print("$$$");
}

void loop ()

{
  Serial.read();
}
 
Logged

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

No, it's powered at 3.3v

I am sure the code is wrong.
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 108
Posts: 5144
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I have it attached to my Arduino Uno R3 on pins 8 and 9 and I am using software serial in the code.

Don't use SoftwareSerial with the RN-XV. It's quite picky about the serial timing and the SoftwareSerial cannot fulfill the needs of the RN-XV. I never got it running using SoftwareSerial but it runs like a charm on the hardware serial.

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


void setup()
{
  Serial.begin(9600);
  delay(500);
  Serial.print("$$$");
}

void loop ()

{
  Serial.read();
}

You instantiate a SoftwareSerial instance but you're printing to the hardware serial interface and read from there.

From the hardware side mine is connected using an XBee shield (from Iteadstudio) that does the level conversion for the serial pins. Without that level conversion you may have destroyed the RN-XV already, the datasheet specifies "3V3 tolerant" whatever that may mean. In the electrical characteristics the voltage is specified with 3.7V max.
Logged

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


Don't use SoftwareSerial with the RN-XV. It's quite picky about the serial timing and the SoftwareSerial cannot fulfill the needs of the RN-XV. I never got it running using SoftwareSerial but it runs like a charm on the hardware serial.


Ah I see.

Quote

You instantiate a SoftwareSerial instance but you're printing to the hardware serial interface and read from there.

From the hardware side mine is connected using an XBee shield (from Iteadstudio) that does the level conversion for the serial pins. Without that level conversion you may have destroyed the RN-XV already, the datasheet specifies "3V3 tolerant" whatever that may mean. In the electrical characteristics the voltage is specified with 3.7V max.

Ah, I see my mistake now. What voltage does the Uno digital write at? I thought it was around 3.3v?

And since I have not been writing to the digital pins this whole time my device appears to be fine.

And thank you!
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 610
Posts: 49004
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
What voltage does the Uno digital write at? I thought it was around 3.3v?
What does you multimeter tell you? Why would you expect a 5V device to output 3.3V on the digital pins?
Logged

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

Sketch Arduino for Wifly RN-XV modem configuration without Wifly library and
with front-end: https://dl.dropboxusercontent.com/u/101922388/WiflySanUSB.zip
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 108
Posts: 5144
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

DON'T CROSS-POST! Especially not if you're advertising, even if you advertise your own sketch.
Logged

Pages: [1]   Go Up
Jump to: