WiFi Shield library

Hey, does anyone have a better library or an example on how to send GET/POST messages to a server? I tried to get the SparkFun library working with this shield but that didn’t work even when I swapped out the SoftwareSerial with a custom one. I don’t really feel like writing my own REST wrapper for this shield so any example is better than nothing.

Thanks

try this one~ :smiley:
cheers~
WiFly.zip (12.9 KB)

Wow! Thank you so much. Why isn’t this somewhere on the wiki – or somewhere searchable. I looked all over github and google for a library like this.

I am going to add code to parse out the header/body and put the source up on github. That way nobody else has to look all over for the library for seeed wifly.

yep~ some guy is writing it ~ but not finished!!when it finished, it’ll appear on the wiki~

you can refer to: github.com/xiongyihui/WiFly.git

Alright, so I have combined the WiFly project https://github.com/xiongyihui/WiFly.git with this HttpClient project https://github.com/amcewen/HttpClient. This http client is more robust than the one that comes with the WiFly project but I am running into issues when parsing the response.

If I just do a while loop and print out the entire response I get the whole message. If I do some logic to parse the message (via the HttpClient) I don’t even finish reading through the header. I am guessing that the logic takes to long and the WiFly rejects some of the response since the buffer is full. It could also be the SoftwareSerial buffer but I am not too sure. I could always just read in the entire response and then parse it but I don’t think that using all that memory would be a good idea. Has anyone seen this behavior when attempting to parse a webserver response?

Thanks

Ahhh… I found my issue. For some reason there was a delay built into the library when the shield didn’t have any data coming in. I will post up the combined library after I clean this up a bit.

How is the library coming?

hey~ I am sorry to tell you that the guy writing the library was busy recently~ :smiley:

maybe you can refer to his github, if there are any updates, it must be there.

Right now I can successfully make a request to httpbin and get a value from the json. I ended up using the jsmn/json_arduino lib since I feel that the other library (aJson) is pretty big. Because of this, I am not sure if the json parser can parse complex objects.

I am not sure about the ETA on this combined library as I only get a few hours a day to work on it but I think that I should have something to show by the end of the weekend. Right now I am just cleaning up the code and making sure I didn’t create any memory leaks – I haven’t touched c/c++ in years haha.