Go Down

Topic: WiFlyHQ: A new library for the WiFly RN-XV (Read 31627 times) previous topic - next topic

A kind off topic question.

I read some tutoriais In the net, where they don't use a wireless shield, they connect directly In the arduino using SoftwareSerial.

The question is: the UART software serial In Arduino is not a 5v communication? If yes, why don't fry the board?

i did the same thing and work fine using your library, the board still working!

Thanks for the help, and sorry my english =]

PaulS

Quote
the UART software serial In Arduino is not a 5v communication?

On a 5V Arduino, it is. On a 3.3V Arduino, it's at 3.3V.


dhunt


i did the same thing and work fine using your library, the board still working!

If you're using a 5V Arduino, then yes you will damage the WiFly over time and it will fail. It could take hours, days, or weeks for the failure to occur.

To fix the problem, add a voltage divider (two resistors) between the pin you're using for TX on the Arduino and the DIN pin on the WiFly module.  A nice write up on how to do this is available here: http://www.savagecircuits.com/forums/content.php?309-Mixed-Voltage-Systems-Interfacing-5V-and-3-3V-Devices.

dhunt


Nice!  Thanks!  I'm writing some brief code to execute commands and retrieve/parse their results.  I've noticed it works at 460k baud using hardware UART, but only 38,400 reliably using SofwareSerial.  For debugging I use SoftwareSerial to Wifly, pins 0,1 for debug messages, but when the code is reliable you can easily switch 2 wires and 1 define to make it faster with hardware UART.  Do you see the same results?

I can only use 19200 baud reliably with SoftwareSerial, but yeah the hardware UART supports much faster speeds.  I think I'll start using software serial for debugging via the serial monitor (with an FTDI USB cable) and the hardware UART for the WiFly module.

ndanl



hi, I have the usb weather board from sparkfun and I am trying to get this http://www.sparkfun.com/products/11047 to get it work but after uploading the httpserver example all I get is this:

Code: [Select]

Starting
Free memory: 1337
setPrompt failed
Failed to enter command mode
Failed to start wifly
Terminal ready


what am I doing wrong ?:(

thanks


The XBee hardware interface looks ok, its directly connecting TX and RX to the WiFly at 3.3V.

Those errors indicate that the Library can't talk to the board. Why don't you post the sketch you are using. It might be a simple problem like you're still using software serial when the WiFly is actually connected to the hardware serial interface, or maybe the baud rate doesn't match the rate set in the WiFly module.


hm, i think that my usb weather board is damaged, since yesterday I can't get anything from serial ... so maybe this is why the wifly module is not working ... I will return :)



i did the same thing and work fine using your library, the board still working!

If you're using a 5V Arduino, then yes you will damage the WiFly over time and it will fail. It could take hours, days, or weeks for the failure to occur.

To fix the problem, add a voltage divider (two resistors) between the pin you're using for TX on the Arduino and the DIN pin on the WiFly module.  A nice write up on how to do this is available here: http://www.savagecircuits.com/forums/content.php?309-Mixed-Voltage-Systems-Interfacing-5V-and-3-3V-Devices.


I understand. I have a Arduino Uno rev. 2. Which wireless shield I need? Or anyone will give the 3.3V?

Thanks for the reply! =]

dhunt

I've posted some shield options on the wiki here https://github.com/harlequin-tech/WiFlyHQ/wiki.

For any XBee shield you are considering, check the schematic for the shield and make sure it has decent level shifting on the DIN pin to the module. Other nice-to-have features are the ability to connect the USB port directly to the module and the ability to switch the serial interface between hardware serial and two other digital pins for SoftwareSerial use.


Waltermixxx

The official arduino wireless proto shield with sd slot has a switch so you can talk directly to the RN-XV via usb...  Might be a good idea to include it.

http://arduino.cc/en/Main/ArduinoWirelessShield


dhunt


The official arduino wireless proto shield with sd slot has a switch so you can talk directly to the RN-XV via usb...  Might be a good idea to include it.

http://arduino.cc/en/Main/ArduinoWirelessShield


Thanks I've added it to the wiki. I assume you have one and its working with your WiFly?

im really glad someone took the time to write a library for this. i live in the netherlands, and i just wanted to be sure that
this module combined with this breakout works in combination with the Wifly HQ library. can anyone confirm? I want to use Arduino as a websocketserver using this!

dhunt


im really glad someone took the time to write a library for this. i live in the netherlands, and i just wanted to be sure that
this module combined with this breakout works in combination with the Wifly HQ library. can anyone confirm? I want to use Arduino as a websocketserver using this!

Those links are a bit broken. But the two items look ok ( sorry I don't understand the language). I think with that XBee shield you will need to modify it if you want software serial support ( e.g to make debugging easier), by cutting off pins 0 an 1 and soldering jumper wires in their places so you can connect the WiFly's serial port to some other digital pins.

I added a WeSockets client example sketch to the WiFlyHQ library here: https://github.com/harlequin-tech/WiFlyHQ/blob/master/examples/WebSocketClient/WebSocketClient.ino. It should be just as easy to create a WebSocketServer. A bit more effort is needed to add key support.

sbright33

I've noticed that when sending large amounts of data it takes twice as long as you might expect.  You have to send a buffer serially to the module, then wait for it to send it to the remote host on the internet.  You cannot do both at once, so it takes more than twice as long.  At 460k baud you might only get 5-10K bytes / sec.  It doesn't seem to matter what is the data rate of Wifi.  It seems like it needs a reply from the FTP host before you can send the next buffer via Serial.  Do your results match mine when testing?

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

dhunt


I've noticed that when sending large amounts of data it takes twice as long as you might expect.  You have to send a buffer serially to the module, then wait for it to send it to the remote host on the internet.  You cannot do both at once, so it takes more than twice as long.  At 460k baud you might only get 5-10K bytes / sec.  It doesn't seem to matter what is the data rate of Wifi.  It seems like it needs a reply from the FTP host before you can send the next buffer via Serial.  Do your results match mine when testing?


I haven't finished the FTP feature, but I'll do some performance measurements when I do. Most likely this weekend.

felis

I have a question - do you have plans to support flow control? I'm losing bytes while ftp-ing large amounts of data at high speed from Arduino.
/felis

Go Up