Page 6 of 6

Re: WiFly Shield code library alpha 2 release

Posted: Sat Apr 07, 2012 11:55 pm
by asummer
I am working on a project where I want to connect to the arduino via telnet and send it commands that will call functions on the arduino. I can connect to the arduino through telnet but am having difficulty figuring out how to store the command sent from the command line via telnet into a buffer on the arduino that I can then string compare and call the corresponding function. Is there a library function or a a place where this string is stored on the shield? If so how do I grab it?



Thanks!

Re: WiFly Shield code library alpha 2 release

Posted: Sun Apr 08, 2012 8:43 pm
by asummer
asummer wrote:I am working on a project where I want to connect to the arduino via telnet and send it commands that will call functions on the arduino. I can connect to the arduino through telnet but am having difficulty figuring out how to store the command sent from the command line via telnet into a buffer on the arduino that I can then string compare and call the corresponding function. Is there a library function or a a place where this string is stored on the shield? If so how do I grab it?



Thanks!

Better yet is there a way i can set, say digital pins 3 and 4 to be high and low using commands after connecting through telnet. I tried using the "set sys output" command but it seems that this works differently than I thought. I will ultimately have two pins switching two different relays. When I set one pin to high it will switch one relay and when I set the other pin to high it will switch the other relay. How can I perform set these pins to high and low wirelessly using the wifly shield?

Re: WiFly Shield code library alpha 2 release

Posted: Tue Apr 17, 2012 5:11 pm
by jrobert755
Hello everyone. I have worked with the WiFly and the library for a while, especially the library as modified by jaycollet, and I've changed some things to make it run smoother. For one, if a connection to wireless or a computer would fail, the program no longer hangs and returns false, meaning that the connection can be tried again. If anyone would like to see/use it, I have uploaded it to Github; the address is https://github.com/jrobert755/WiFly-Shield.
asummer wrote:I am working on a project where I want to connect to the arduino via telnet and send it commands that will call functions on the arduino. I can connect to the arduino through telnet but am having difficulty figuring out how to store the command sent from the command line via telnet into a buffer on the arduino that I can then string compare and call the corresponding function. Is there a library function or a a place where this string is stored on the shield? If so how do I grab it?



Thanks!
Neither the WiFly nor the Arduino libraries have a standard function for what you need, per se. The WiFly shield stores all that it gets until you read it, but the message can only be read one byte at a time, so to get the whole thing, you have to keep reading and saving the bytes until you get the whole message. I am doing something very similar to what you need, though, and I can help. I am working on a project where the WiFly shield connects to a server, and they send messages back and forth, with the Arduino, once it gets the whole message, calls a function based upon what the first section of the message is. I can help you adapt it to what you need, if you would like me to.

Re: WiFly Shield code library alpha 2 release

Posted: Tue Apr 24, 2012 7:38 am
by rtdinesh
hi,

I uploaded Wiflyautoconnnect terminal code to the arduino mega and it worked. I need to create a UDP socket in my wifly shield. Is it possible to use the wifly serial library for full wifly shield + arduino mega ? can some one suggest me an idea to implement a UDP socket ?

Re: WiFly Shield code library alpha 2 release

Posted: Thu May 17, 2012 6:15 pm
by idaneo
Where are the pin numbers defined in the Alpha 2 release?
I'd like to change the chip select from 10 to something else so I can use it in conjunction with another shield.

Also, has anyone tried sharing the SPI bus with another shield? I read somewhere else that they couldn't get the arduino to stop trying to talk to the WiFly.

Cheers,
daneo

Re: WiFly Shield code library alpha 2 release

Posted: Wed Jun 13, 2012 3:09 am
by mohamedosama
i hv configured the module as stated in the reference guide, now i just wanna to send serial data from pc to wifly using the configured IP and Port number,,,so please help ,, thaanks

Re: WiFly Shield code library alpha 2 release

Posted: Sun Jul 15, 2012 5:27 pm
by mtstarr
I am writing a WiFlySMTPClient, based off of WiFlyClient and I have run into a few problems, first were header includes. I have sorted it out but the include's seems create very strange compiler issues. A good example is SPI and SPIUart.

Onto the client, in WiFlyClient.h there is a reference to a WiFlyDevice called _WiFly.

private:
WiFlyDevice& _WiFly;

Here is uart in WiFlyDevice, note it is private.
private:
SpiUartDevice& SPIuart;
Stream* uart;
boolean bDifferentUart;


In WiFlyClient.cpp, they use the _WiFly member variable but access private members and functions.

size_t WiFlyClient::write(byte value) {
/*
*/
_WiFly.uart->write(value);
return 1;
}


size_t WiFlyClient::write(const uint8_t *buffer, size_t size) {
/*
*/
while(size--)
_WiFly.uart->write(*buffer++);
return size;
}

It compiles, I don't know how. I have taken the two files, copied them to WiFlySMTPClient.h/cpp, removed a couple of no-applicable functions and I get that uart is a private member. If I move it to public, it works. So, what is confusing is how can they access a private member, did I miss a "friend" or somethings. Anyone got an idea

matt

Re: WiFly Shield code library alpha 2 release

Posted: Tue Jul 31, 2012 9:08 am
by jrobert755
mtstarr, what version of the library are you using? In the alpha 2 version, WiFly.uart is of type SpiUartDevice&. Also in alpha 2, in WiFlyDevice.h, near the bottom of the class definition, Client and Server are declared as friends.

Re: WiFly Shield code library alpha 2 release

Posted: Sat Aug 11, 2012 9:13 pm
by alecdavis
Tijean wrote: And I replaced
-- if (WiFly.responseMatched(TOKEN_MATCH_OPEN)) {
by
++ if (WiFly.findInResponse(TOKEN_MATCH_OPEN, 1000))
This needs to be in the 'alpha3' library.

Using Roving Networks 2.32 firmware.
Spent last few days tracking this down, then after I knew the problem, I then searched findInResponse, and find it's been here for nearly a year.

Using either the Server example or the ADHOC example, both, intermittently responded before this patch.

Re: WiFly Shield code library alpha 2 release

Posted: Mon Sep 17, 2012 3:28 pm
by varuninnz
Hi guys, I have 2 questions.
I've been banging my head against the wall trying to get the RN-XV shield working. I can program the shield manually for infrastructure mode, via Putty.
I've found this library, but I don't know how to find the revision of my RN-XV 171 shield.
1. Can someone please help me out finding the revision of my RN-XV 171 shield?
2. Will this library actually work for RN-XV because as I mentioned b4 I've banging my head trying to get this shield working for over 4 weeks now. I have also found ANOTHER Library today, WiflyHQ.

My main purpose of using this shield is so I can send emails via smtp. Basically this will involve me using infrastruce mode to connect to my router. I have managed to write up some code and Im getting no compiling errors but I can't test because the library client functions are not working. so the program gets stuck at
if (!WiFly.join(ssid, passphrase)) {

Re: WiFly Shield code library alpha 2 release

Posted: Mon Sep 17, 2012 3:30 pm
by varuninnz
Also how do I find the revision of the WIfly RN-XV shield?