Just got a WiFly shield - and when I update the firmware the latest one it will give is 2.23 !! I cannot find/get 2.26.
Also your library appears to have lost the WiFly.Configure(…) method along the way (your commit of 2011-07-19 19:21:32) - was this intentional?
Best regards
John.
John:
The guys over at RovingNetworks gave me the image name to use, just issue this command once you are connected to the internet on the WiFly:
ftp u wifly-226.img
Then power off and power on the Wifly, you’ll have the new firmware. The old one is actually still on the WiFly, you can use the file commands on the WiFly to remove the old one.
Not sure what you mean about the Configure() being gone? Can you elaborate? There should only be additions and a few modifications to the Alpha 2 version I forked off of. I’m still working on the library, I’ve got about a dozen tweaks, working directly with RovingNetworks on getting this as solid as I can. The project I"m using it for really needs to have a reliable connection (for a hobby project).
I’m a bit new to the arduino environment and the WiFly board. I’ve been trying to modify the WiFly library to support pinging but can’t get the arduino environment to recognize my change. Below is a snippet showing what I changed. After I made my changes I made sure the newest files were in the proper library folder and restarted the arduino environment, but when I try to compile I get this error: “‘class WiFlyDevice’ has no member named ‘connectionActive’”. Is there a step I’m missing?
I fully agree. When I bought this shield I did not realize that there would be no software support from SparkFun. No offense to the creator of the current library and to further update coders. Thanks to their efforts the product is useable to a certain degree but I am sort of puzzled as to how SparkFun can sell something like this that requires software libraries to operate and then not invest in making them available and stable.
This part stop working after a few days. and the code don’t see an active http request (client connect)
If there is new and better code to handle this I would be very greatfull to try it out.
Client& Server::available() {
/*
*/
// TODO: Ensure no active non-server client connection.
if (!WiFly.serverConnectionActive) {
activeClient._port = 0;
}
// TODO: Ensure begin() has been called.
// Return active server connection if present
if (!activeClient) {
// TODO: Handle this better
if (WiFly.uart.available() >= strlen(TOKEN_MATCH_OPEN)) {
if (WiFly.responseMatched(TOKEN_MATCH_OPEN)) {
// The following values indicate that the connection was
// created when acting as a server.
// TODO: Work out why this alternate instantiation code doesn't work:
//activeClient = Client((uint8_t*) NULL, _port);
activeClient._port = _port;
activeClient._domain = NULL;
activeClient._ip = NULL;
activeClient.connect();
WiFly.serverConnectionActive = true;
} else {
// Ignore other feedback from the WiFly module.
// TODO: Should we check we're not ditching a connect accidentally?
//WiFly.skipRemainderOfResponse();
WiFly.uart.flush();
}
The WebClient sketches do work well, I get an IP address and the GET request is done correctly.
But the Web Server does not work. I am able to ping and I get a reply. But when I make the HTTP Request via the browser I get no reaction (even no timeout)
I am using WRL-09954 & sparkfun-WiFly-Shield-wifly-library-alpha-2-11-g981ea95
I also had the Ethernet library in my libraries folder. I removed it to be sure to have no Server.cpp/h, … clashes. But it did not help.
Note that I only connected the pins 10,11,12,13, GND & Vin to the Arduino, but I do not expect any issue there, right ?
Any insights on root cause and/or tips on how to debug?
@Tijean: The example sketches work for me, although the server is slow. I have an Arduino Mega, but for you connecting those pins should be enough indeed.
@forum: When I try to do something with the Wire library, the program seems to halt.
Is there any reason why the WiFly library and the Wire library should conflict?
It specifically stops when I do an “Wire.endTransmission();”
That’s reminiscent of an old vaudeville joke: A guy goes to his doctor and, while reaching up between his shoulder blades with his left hand, says, “Doctor, it hurts when I do this.” And the doctor replies…
Ok, I found a solution that seem to help my problem.
I used jaycollett / WiFly-Shield library, which resulted in some requests correctly handled but after some time, no replies.
Thanks to the TODO comments in the code, I analysed the data available in the Uart and noticed that there are still some remaining data before the OPEN
This results in WiFly.responseMatched(TOKEN_MATCH_OPEN) completely missing OPEN token and thus flushing it
WiFly.uart.flush() & WiFly.skipRemainderOfResponse() did not solve the problem for the next request.
So how did i fixed it?
In the function Server::begin(), I added WiFly.uart.flush();
And I replaced
– if (WiFly.responseMatched(TOKEN_MATCH_OPEN)) {
by
++ if (WiFly.findInResponse(TOKEN_MATCH_OPEN, 1000))
So give it a test if it helps. And if so I hope the library owners will pick it up.
It doesn’t really help solve your problems but as I noted on my blog (http://ronguest.com/blog/2011/09/arduin … -hardware/)Arduino just announced their own “official” Wifi shield and it is expected to ship soon. The hardware is quite different - doesn’t use the UART for communication among other things - so the new Ethernet library (from Arduino) won’t work with the WiFly. The Arduino shield has it’s own processor and will be fully hackable. I’m planning to switch once I can get my hands on one due to the sorts of issues mentioned here. I’m very happy I got to play with the WiFly though. It was fun!
I have downloaded the latest version of the library and have come across a problem.
Using WPA-PSK if the passphrase contains a space character (which appears to be allowed) then you will not be able to authenticate to the network. The library executes a set wlan passphrase to load the passphrase but it only uses up to the space character so the passphrase is then incorrect.
e.g. if you have a passphrase of
network password
doing a get everything via the terminal shows the passphrase to be network
Indeed doing a set wlan passphrase network password results in the same thing.
I had to change the network passphrase to change the space to _ to get round it which is a pain as then I have to change all the other devices connected wirelessly.
I think this project is dead and sparkfun is not supporting there own arduino shield with a working library it’s very bad support and I will from now avoid anything to do with sparkfun!
I regret I bought the wifly shield and I hope people read this topic before they do the same mistake as I!
My Wify Shield is finally stable after I made a few modifications to the code (many thanks to the past posts for pointing me in the right direction). I wanted to share what I did to modify the Wifly.h library.
First a little bit about the problem I was experiencing. I have my Wifly shield setup in the server configuration, which will send a simple XML document back with the status of a few proximity sensors and if the right command is sent (via HTTP GET variables), it will trigger the switch to go high for one second. I have this hooked up to my garage door, so that I can open my garage door from a browser on my mobile device. While unit testing, everything seemed to be working but after about 10 successful requests the Wifly shield stopped taking HTTP requests. I could still ping the device; however, the server wasn’t responding. The browser request wouldn’t really even time out, which I still find strange. The green light on my Wifly Shield was no longer blinking it was solid green. I had to pull the power to get it back up and running. I setup a few debug lines of code in the Wifly library (mainly within the server.cpp code). I found that there was some extra characters being sent to the Wifly shield, which it was not expecting and therefore would not open the connection. This seems to be the exact same scenario as Trjean posted and I found the solution to be for the most part the same. The only thing is you really don’t need to do the flush all you need to do is modify the if statement below.
Note: This code is in the Server.cpp file.
// Return active server connection if present
if (!activeClient) {
// TODO: Handle this better
if (WiFly.uart.available() >= strlen(TOKEN_MATCH_OPEN)) {
//if (WiFly.responseMatched(TOKEN_MATCH_OPEN)) { <-- **** REMOVE THIS LINE ****
if (WiFly.findInResponse(TOKEN_MATCH_OPEN, 1000)) { // <--REPLACE WITH THIS
// The following values indicate that the connection was
// created when acting as a server.
I setup a simple load test that sent a request to the Adrunio, which is connected to my network via the Wifly shield, once every minute for 2 days and I am happy to report that it’s still up and running!! I am fairly confident that it is fixed with this minor modification to the library.
P.S. Hey roadfun - I am not sure why you thought this wouldn’t work? While the new Adrunio Wifi shield looks great, I am more interested in making the one I got work! 80 bucks is a lot of money for me!! :roll:
I saw user “resamsel” posted a question about using Bonjour over wifi:
is there any chance to get the WiFly library to work with the Bonjour/Zeroconf library (http://gkaindl.com/software/arduino-ethernet/bonjour)? Is there anything “obvious” that I can do (I’m not too experienced with C programming)?
Thanks
René
Has René or anyone else run across a solution? I find myself in the same situation. I’m thinking about using a bit of a hack (based on this: http://www.practicalmaker.com/blog/ardu … ur-library), but I’d prefer Bonjour if there’s a straightforward way to modify either the WiFly or Bonjour library.
fableman:
I think this project is dead and sparkfun is not supporting there own arduino shield with a working library it’s very bad support and I will from now avoid anything to do with sparkfun!
I regret I bought the wifly shield and I hope people read this topic before they do the same mistake as I!
The WiFly shield is more complex then most of the plugNplay shields and code is being developed by users, not Sparkfun. dkflybou solved your server problem. You could have done it instead of whining like a little bitch.
Perhaps you just aren’t ready to me taking on such an advanced project.
Got a problem with a project I’ve got going I’m hoping someone might be able to advise me on. I’m running a small Arduino sketch which is basically an extension of the WiFly library WebClient example. All it is is a simple loop, which periodically GET(s) a server file. Right now I’ve got it connecting to the server every 30 seconds or so just to check things out.
Things been working pretty well so far (the library has been a big help in getting up and running quickly), but every once in a while the program just hangs. I can typically access my server successfully hundreds of times, then the program will just hang. Adding some debug code to the source files, it looks like things are getting hung right at client.connect() … more specifically during the WiFlyDevice responseMatched() function … and yet more specifically right at the while (!uart.available()) step. It’s apparently not catching the OPEN response from the WiFly device, then hitting the infinite loop. (I’m making an assumption here that some sort of uart issue is involved … I need to however consider the possibility that I’m indeed just not connecting to the server for some reason, but this harder to verify. Based on some previous postings, I’m believing the most likely problem is between the WiFly ad Arduino).
I’ve read the previous forum postings from dk and Tijean discussing a very similar issue, and some solutions, when using the module in server mode. I’m not sure if something similar might be happening in my case. I’m going to keep working on this one to see if I can stabilize the module (i.e. keep it from hanging during continuous operation accessing the server, hopefully over many days), but would also appreciate any thoughts or insight anyone might have on this one.
Thanks in advance … (and sorry for the long post).