WiFly Shield code library alpha 2 release

For the discussion of Arduino related topics.

Moderator: phalanx

Re: WiFly Shield code library alpha 2 release

Postby asummer » Sat Apr 07, 2012 11:55 pm

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!
asummer
 
Posts: 2
Joined: Sat Apr 07, 2012 11:48 pm

Re: WiFly Shield code library alpha 2 release

Postby asummer » Sun Apr 08, 2012 8:43 pm

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?
asummer
 
Posts: 2
Joined: Sat Apr 07, 2012 11:48 pm

Re: WiFly Shield code library alpha 2 release

Postby jrobert755 » Tue Apr 17, 2012 5:11 pm

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.
jrobert755
 
Posts: 2
Joined: Tue Apr 17, 2012 4:44 pm

Re: WiFly Shield code library alpha 2 release

Postby rtdinesh » Tue Apr 24, 2012 7:38 am

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 ?
rtdinesh
 
Posts: 1
Joined: Tue Apr 24, 2012 7:35 am

Re: WiFly Shield code library alpha 2 release

Postby idaneo » Thu May 17, 2012 6:15 pm

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
idaneo
 
Posts: 1
Joined: Thu May 17, 2012 6:09 pm

Re: WiFly Shield code library alpha 2 release

Postby mohamedosama » Wed Jun 13, 2012 3:09 am

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
mohamedosama
 
Posts: 1
Joined: Wed Jun 13, 2012 1:37 am

Re: WiFly Shield code library alpha 2 release

Postby mtstarr » Sun Jul 15, 2012 5:27 pm

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
mtstarr
 
Posts: 3
Joined: Fri Jun 25, 2010 6:17 am
Location: Boulder, CO

Re: WiFly Shield code library alpha 2 release

Postby jrobert755 » Tue Jul 31, 2012 9:08 am

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.
jrobert755
 
Posts: 2
Joined: Tue Apr 17, 2012 4:44 pm

Re: WiFly Shield code library alpha 2 release

Postby alecdavis » Sat Aug 11, 2012 9:13 pm

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.
alecdavis
 
Posts: 1
Joined: Sat Aug 11, 2012 2:20 am

Re: WiFly Shield code library alpha 2 release

Postby varuninnz » Mon Sep 17, 2012 3:28 pm

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)) {
varuninnz
 
Posts: 7
Joined: Fri Sep 14, 2012 6:53 pm

Re: WiFly Shield code library alpha 2 release

Postby varuninnz » Mon Sep 17, 2012 3:30 pm

Also how do I find the revision of the WIfly RN-XV shield?
varuninnz
 
Posts: 7
Joined: Fri Sep 14, 2012 6:53 pm

Previous

Return to Arduino

Who is online

Users browsing this forum: No registered users and 7 guests