SparkFun Forums 

Where electronics enthusiasts find answers.

For the discussion of Arduino related topics.
By asummer
#142516
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!
By asummer
#142558
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?
By jrobert755
#143102
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.
By rtdinesh
#143416
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 ?
By idaneo
#144703
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
By mohamedosama
#145963
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
By mtstarr
#147425
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
By jrobert755
#148063
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.
By alecdavis
#148366
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.
By varuninnz
#149493
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)) {
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]