Go Down

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

4321

Hi,

I just got a Wireless SD Shield (http://arduino.cc/en/Main/ArduinoWirelessShield) and a Roving Networks RN-XV.  I am having trouble getting started using the module to host a webserver.

I discovered the WiFlySerial library and figured it would work with this setup.  However I cannot get it to work.

I have been able to manually configure the wireless module using the arduino serial monitor, so I am guessing that the WiFlySerial library is not the correct library to use.  Can anyone point me towards a tutorial or anything that might help get me rolling?

Thanks

Waltermixxx

Never used it as a web server, but did use it with an iPhone app that sends udp messages that the arduino will respond to.  Do a search for my posts, I don't have too many, and the should all be about the RN VX wify module...

Cheers!

4321


Never used it as a web server, but did use it with an iPhone app that sends udp messages that the arduino will respond to.  Do a search for my posts, I don't have too many, and the should all be about the RN VX wify module...

Cheers!


Thanks I will look them up.

4321

I am still having the problem that I cannot communicate with the RN-XV via my code.  If I use an empty sketch I can communicate with the the RN-XV via the serial monitor in the Arduino IDE.  So I guess it works. 

However, I cannot figure out which pins to use to talk to the module from my sketch.  Can anyone help me out?  I have the official Wireless SD Shield and an RN-XV.

Do I have to do some sort of configuration to tell the RN-XV which pins to use as TX and RX?  And how do the Arduino pins and the RN-XV pins sync up? I.e. is arduino pin #1 the RN-XV pin 1?  Maybe that is what is throwing me off. 

I've read through everything I can find but I am having no luck.  I figured since there was now an "official" wireless shield that there would be some sort of working code and a tutorial demonstration but I cannot find anything.

4321

I guess the main help I need is: what pin on my arduino uno corresponds to the TX pin on the RN-XV and what arduino pin corresponds to the RN-XV RX pin?

I could not find this in any of the documentation.  If it is there, I apologize, but can you please point it out to me.

Thanks

dhunt

#5
Apr 08, 2012, 10:27 pm Last Edit: Apr 08, 2012, 10:29 pm by dhunt Reason: 1
The shield you are using connects the WiFly serial to the Arduino's hardware serial ( pins D0 and D1). To make development easier I'd suggest removing D0 and D1pins from the shield and using two jumper wires to connect those pins to two other digital pins (e.g 8 and 9), then use software serial to communicate with the WiFly and keep the hardware serial for debug via the hardware monitor. If you want to later switch the WiFly back to the hardware serial interface ( e.g. for faster baud rates) you can connect the jumper wires directly to the D0 and D1 sockets on the arduino, or solder two new pins to the shield.

I've written a library for the RN-XV available here: https://github.com/harlequin-tech/WiFlyHQ. It's at version 0.1 and I'll add an http server example and update to it today.

Edit: fixed link.

4321


The shield you are using connects the WiFly serial to the Arduino's hardware serial ( pins D0 and D1). To make development easier I'd suggest removing D0 and D1pins from the shield and using two jumper wires to connect those pins to two other digital pins (e.g 8 and 9), then use software serial to communicate with the WiFly and keep the hardware serial for debug via the hardware monitor. If you want to later switch the WiFly back to the hardware serial interface ( e.g. for faster baud rates) you can connect the jumper wires directly to the D0 and D1 sockets on the arduino, or solder two new pins to the shield.

I've written a library for the RN-XV available here: https://github.com/harlequin-tech/WiFlyHQ. It's at version 0.1 and I'll add an http server example and update to it today.

Edit: fixed link.


Thanks for the response.  I will give your library a shot.  It looks good.  The only problem is that I need to run in ad-hoc mode and ad-hoc is listed as a to-do on the github page.  I have set the module to default to the ad-hoc network I need, so maybe I can skip network setup in the library and just use it for the webserver interaction.

4321

dhunt,

Thanks so much for sharing your library.  My arduino is now connected to my network.  I cannot remove pins on my shield because I am borrowing the Wireless Shield at this time.  I am thinking I could possibly use a log file for debugging output and make it available via the http server when needed instead of adjusting the pins.  Anyways, I'm going to tinker some more.  Just wanted to let you know I got it working and thank you for sharing the library.

Thanks

dhunt

Cool that that's working for you.

A low-cost shield that I've found to be good for the WiFly RN-XV is this one from SeeedStudio. It has a switch to change the serial connection for D0,D1 to D11,D12.  Good for SoftwareSerial as long as you don't want to use the SPI interface for something else.

KirAsh4

#9
Apr 11, 2012, 09:31 am Last Edit: Apr 11, 2012, 09:51 am by KirAsh4 Reason: 1
Trying to get  stand alone RN-XV module to work here.  I have this RN-XV WiFly module paired with an XBEE shield stacked ontop of my Uno (R2).  The shield has a switch that changes TX/RX to pins D2 and D3.  Trying to use the WiflyHQ library but I can't get it to work.

I loaded the httpclient example.
Set mySSID and myPassword according to my Wi-Fi network.  I changed the pins from 8,9 to 2,3 and hit upload ...   It compiled with no problem and uploaded with no problem.  But when I opened my serial monitor, this is what I see:
Quote
Starting
Free memory: 1161
setPrompt failed
Failed to enter command mode
Failed to start wifly
Auto-Assoc roving1 chan=0 mode=NONE FAILED
Auto-Assoc roving1 chan=0 mode=NONE FAILED
Auto-Assoc roving1 chan=0 mode=NONE FAILED
Auto-Assoc roving1 chan=0 mode=NONE FAILED
... ad infinitum


Any ideas?

iball


Trying to get  stand alone RN-XV module to work here.  I have this RN-XV WiFly module paired with an XBEE shield stacked ontop of my Uno (R2).  The shield has a switch that changes TX/RX to pins D2 and D3.  Trying to use the WiflyHQ library but I can't get it to work.

I loaded the httpclient example.
Set mySSID and myPassword according to my Wi-Fi network.  I changed the pins from 8,9 to 2,3 and hit upload ...   It compiled with no problem and uploaded with no problem.  But when I opened my serial monitor, this is what I see:
Quote
Starting
Free memory: 1161
setPrompt failed
Failed to enter command mode
Failed to start wifly
Auto-Assoc roving1 chan=0 mode=NONE FAILED
Auto-Assoc roving1 chan=0 mode=NONE FAILED
Auto-Assoc roving1 chan=0 mode=NONE FAILED
Auto-Assoc roving1 chan=0 mode=NONE FAILED
... ad infinitum


Any ideas?


This means that you're wifly is working on the correct serial ports however it's still setup for the default settings of auto-connecting to an open wifi network.
See where it says "Failed to enter command mode"?  That indicates that the program was not able to re-configure your wifly's SSID and passphrase settings.
Check the code again and reboot.  I ran across this once when I first started using the WiflyHQ library but after a quick reset and re-upload it started working again.
If your RN-XV uses an external antenna, make sure it's connected.

dhunt

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()
{
    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.

guyandhismonkey


The shield you are using connects the WiFly serial to the Arduino's hardware serial ( pins D0 and D1). To make development easier I'd suggest removing D0 and D1pins from the shield and using two jumper wires to connect those pins to two other digital pins (e.g 8 and 9), then use software serial to communicate with the WiFly and keep the hardware serial for debug via the hardware monitor. If you want to later switch the WiFly back to the hardware serial interface ( e.g. for faster baud rates) you can connect the jumper wires directly to the D0 and D1 sockets on the arduino, or solder two new pins to the shield.

I've written a library for the RN-XV available here: https://github.com/harlequin-tech/WiFlyHQ. It's at version 0.1 and I'll add an http server example and update to it today.

Edit: fixed link.


Hello I'm using exactly the same setup with a Wifly RN-XV, Wireless SD Shield and Arduino UNO and experiencing the same problem. I am able to remove pins on My shield but Not sure what pins D0 and D1 are. Pins I have are A0 to A5, RX 0, TX 1 - 13. Thanks for the information so far this has been very useful as I have messed around with this for weeks and unfortunately I a noob at Arduino :smiley-mr-green:. Please Can anyone be kind enough to help? 

dhunt

D0 and D1 are digital pins 0 and 1. If you clip them off and jumper them to another two digital pins you can use software serial at 9600 or 19200 to talk to the WiFly.

KirAsh4


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()
{
    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.

Go Up