patrickfelstead asked: Hi Tom, great libraries, excellent to get me started. I'm getting some garbage characters when using the WiFly_Test sketch. It looks like the sort of effect from a slightly wrong baud rate, but the funny thing is, when setup has finished, the main terminal loop lets me interact with WiFly module perfectly, so I think there might be a timing bug somewhere in your command/response library?
Here is an example of the errors:
Starting WiFly Tester.
Free memory:977
CMD
Cmd:
set u m 0x1
Ind:
AOK
<2.23> sþuþ0þ
AOK
<2.23>
Cmd:
set u b 9600
Ind:
AOK
<2.23> SþAOK
<2.23>
ñ&æ³f
ERR: ?-C#Lf2ù¬`µÙ£ly Ver 2.23, 04-26-2011 on 131C65
<2.23>GotPrompt:
<2.23>
Starting WiFly.
Free memory:977
WiFly begin mem:977
MAC: Cmd:
get mac
Ind:
Addr=
<2.23>
Mac Addr=00:06:66:13:92:bb
<2.23>00:06:66:13:92:bb
Cmd:
get ip
Ind:
F=
Do you have any idea what might be causing this? I recompiled the code with 19,200 baud with a very similar result.
Thanks
Patrick
Hi Patrick,
Actually there is a fair amount of code in the library to work through this effect… (note that ‘work through’ != ‘perfect resolution’).
NewSoftSerial - the library used for communications to WiFly - is effectively half-duplex: it can either send, or receive, but not both at the same time.
By default the WiFly will echo characters sent to it, thereby causing collisions in NewSoftSerial and resulting icky (a technical term) noise. The WiFlySerial library makes a point of repeatedly sending the following command:
set u m 0x1
which sets the WiFly into non-echo mode, resolving the bulk of these issues. Remaining noise seems to be at the NewSoftSerial side. As a bit-banger library there are limits to what it can guess are the starting and ending bits, and it seems to need a few characters before it figures out the right sync. Once it’s going it does very well and data is transferred accurately.
That all said, there may well be a simple tuning adjustment that would resolve all this… suggestions are welcome.
Cheers,
9:37 am • 25 June 2011
WiFly Demo Build
Hi all,
A page showing a demo build with a WiFly is now available at http://arduinology.tumblr.com/WiFlyBuild.
Comments and corrections welcome!
Cheers,
7:43 am • 21 June 2011 • 9 notes
mckworkman asked: I went back to the WiFly Tester and my serial port is giving me
Starting WiFly Tester.
Free memory:973
Auto-Assoc roving1 chan=0 mode=NONE FAILED
Auto-Assoc roving1 chan=0 mode=NONE FAILED
...
So what does this mean? I have gone through the diagnostics page and also made sure everything is hooked up just like Cairo hacker Space suggests.
This is good news! It shows that:
1) at least power, ground and receive pins are connected and set properly in your script
2) WiFly is performing normally as at factory-reset behavior.
3) WiFly_Test is operating correctly, and there are 973 bytes free memory.
At this point you could start command-mode by typing ‘$$$’ as the attention signal - no extra CR - (if your Tx is set correctly) then experiment with commands like ‘ver’, ‘get ip’ etc from the WiFly manual.
Using the Arduino IDE, first set the serial port to ‘No CR/LF’ to send the attention signal $$$, then once command-mode entered, set it to end line with a CR.
Then follow through with WebTime, (adjusting for your SSID and passphrase, and pins) and look for results on <arduino-ip-as-assigned-by-your-dhcp-service>:2000
You’re really close!
Cheers,
3:57 pm • 15 June 2011
mckworkman asked: Hi!
I have been trying to get the UDPSample sketch to work with my arduino Duemilanove and the WiFly RN131C breakout board from sparkfun. The code compiles and uploads fine but when I open the arduino serial port I only get output that it is starting WiFly Ram then nothing else so this leads me to think that it is getting stuck at the part in the code the says GetMac . What are the initial configuratoion settings supposed to be? Does it have to be connected to a wireless server with internet in order to get the code? Do I have to configure anything in Teraterm first or do the default settings on it put it in the mode it is supposed to be in. I have downloaded Netcap and am using it on windows with cygwin but am not gettigng time or anything.
Thanks for the help!
McKinnley
Hi McKinnley,
A good starting point for diagnostics is to make sure WiFly_Test is communicating with the WiFly - that confirms pin wiring corresponds with your code settings for input/output.
Go through the WiFly Diagnostics page - that covers many common issues.
As a wireless device it is expected that there is an access point somewhere nearby - whether an ad-hoc or infrastructure - to connect to, that also provides a path from your pc to the arduino.
Remember to update your network SSID and passphrase… fairly deliberately the UDPSample default is for a WPA network, not *hacked* WEP or *gasp* wide-open. With some guidance found at http://cairohackerspace.blogspot.com/ you can change the network type fairly easily.
Netcat is good for listening on ports, glad that you have it installed.
For time services, the UDPSample will try to get time from a NIST server on the internet - if it can’t get there it’ll have a date from 1970-01-01-00-00-00.
Cheers,
1:09 pm • 15 June 2011
olfi asked: i had write an app on blackwidow, runs ok, , but the hardware it isnt buyable now
what can i do? i need 10 blackwidows or compatible.
can you send me links to simple wifi solution: wireing plan arduino-wifi
(ZG2100 or MRF24WB0MA ??)
Hi olfi,
RN131/171 are good chips - needs only 4 wires.
From the WebTime example here:
// Connect the WiFly TX pin to the Arduino RX pin (Transmit from WiFly-> Receive into Arduino)
// Connect the WiFly RX pin to the Arduino TX pin (Transmit from Arduino-> Receive into WiFly)
//
// Connect the WiFly GND pin to an Arduino GND pin
// Finally, connect the WiFly BATT pin to the 3.3V pin (NOT the 5v pin)
#define ARDUINO_RX_PIN 2
#define ARDUINO_TX_PIN 3
Sourcing:
http://www.digikey.com/1/parts/2197722-module-802-11b-g-2-4ghz-rn-171.html
http://www.sparkfun.com/products/10004
http://www.sparkfun.com/products/10050
Also see a nice construction blog using these libraries:
http://cairohackerspace.blogspot.com/
Cheers,
10:42 am • 15 June 2011
ashirwad asked: Hello Sir.Thank you very much for the reply.The project works like this.I have attached an optical sensor to arduino.It senses images and computes optical flow depending on the program in arduino.The program is working fine and i am gettin output when i connect the arduino to computer through cable.Now i want a wifly connection.The receive and send data to and from arduino should be wireless.i am not able to understand how to do that.and a bit nervous because submission date is nearing.ill be very thankful to you if you can help me sir.
Hi ashirwad,
Great to have some further details on the project, and it sounds like you are making good progress. It is not yet clear from the message above where Arduino’s output data is intended to be received - the server side question. And I’ll assume that by ‘through cable’ you mean the USB cable.
The WiFly connection can be configured to:
1) send data to a port on a specific server — see UDPSample for details, using TCP if needed. Then listen on the server side with netcat or telnet (to the same port of course).
2) respond to http requests — see the WebTime example. A browser requests a page built by the Arduino.
3) bidirectional terminal similar to usb cable - slightly tricky but achievable to a certain extent. See WiFly_Test for a general model.
As a serial transport device, the WiFly will echo through wifi what is sent to it. Use WiFly.uart.print instead of Serial.print to do that once a connection is formed.
A question you need to answer is: how you would interact with your Arduino project if you pretended it was attached via an Ethernet cable? … Your answer should then select 1,2 or 3 above.
Cheers,
10:10 am • 15 June 2011
ashirwad asked: Hello.I have arduino pro and rn131c wifly gsx.I need urgent help for my graduation project.i need to connect wifly to arduino.i need help in programming.i dont know how to program arduino to send data through wifly.I want to send you the arduino sketch file but cant attach it here.
Hi ashirwad,
I’d need more information on what you’re trying to do before giving a specific answer. Till then:
1. Check the readme’s in the samples - they discuss the Arduino pin-to-WiFly connections.
2. Sending data to the WiFly is like communicating with any other serial device - really just WiFly.uart.print statements - the WiFly will transmit those print statements to your connected server verbatim. Check the UDPSample for some examples.
What is sent depends on what will receive it: a web server might interpret a GET with variables being your data values, or it might want a PUT statement instead. That choice is up to you or your web-server application.
NetCat and its MS-equivalents could capture TCP or UDP messages.
The WebTime example is another approach: the Arduino becomes a server, responding to GET requests with an HTTP response.
The best approach depends on your project requirements and constraints. Check with the Arduino forum http://arduino.cc/forum/ in the Project Guidance area for architecture ideas.
I’ll help with WiFly and Arduino questions while respecting your institution’s integrity expectations.
Cheers,
9:31 pm • 8 June 2011
Diagnostics posted
Diagnostics page now set up - suggestions and additions are welcome.
Cheers,
8:28 pm • 28 May 2011
kimokono asked: Thanks for your response, it turned out that the problem was with the power source, once i made it to take power through the 3.3V pin of the arduino it worked perfectly, Thank you again
One more to add to the diagnostic list!
Glad it worked — post your project on the Arduino forum and let us know when it’s there.
Cheers,
9:39 am • 16 May 2011
kimokono asked: Hi, i am extreamly grateful for you making this wifly library as i always had issues with the Wifly card.
I'm trying to use your WiFlySeiral Drivers with an arduino Uno board. I've uploaded the webTime sketches and placed the tx rx connections correctly but the Uno Board doesn't seem to communicate with the wifly board.
it always stop after 'Free Memory:981'
i tried all your advice you have specified in your post to the last question by "quadv4" and i still can't make it to work, btw im connecting the arduino to pc through usb and the wifly has it's own power source, would that be the problem or it doesn't matter that each has it's own source of power?? Thanks
Try a hard-reset of the WiFly to bring it back to factory settings; then triple check the rx-tx crossover, and ensure the Uno pins actually used are set in the sketch in the right order.
I’ll add these to the diagnostic list.
Cheers,
4:08 pm • 13 May 2011