wifly

» Import this programWifly_HelloWorld

Hello World with a wifly module (RN 131 C/G - RN-XV)

1200

Information

With this library, you will be able to add a wireless connectivity to your mbed. This library relies on wifly modules from Roving Networks. These modules can be found on sparkfun for instance.

The objective of this library is to provide the same API as the EthernetInterface. So all programs using the EthernetInterface are compatible with the WiflyInterface.

Software

The WiflyInterface library provides you with a simple API to connect to the internet.

» Import this library into a program

Public Member Functions

  WiflyInterface (PinName tx, PinName rx, PinName reset, PinName tcp_status, const char *ssid, const char *phrase, Security sec=NONE)
  Constructor.
int  init ()
  Initialize the interface with DHCP.
int  init (const char *ip, const char *mask, const char *gateway)
  Initialize the interface with a static IP address.
int  connect ()
  Connect Bring the interface up, start DHCP if needed.
int  disconnect ()
  Disconnect Bring the interface down.
char *  getIPAddress ()
  Get IP address.

Getting started

First determine which pins of your WiFly module are power, ground, TX & RX. These should be connected to the mbed's pins accordingly. Make sure you haven't got the TX and RX mixed up. Murphy's law states this will be the case if you do not check beforehand. If you receive no response from the module, this is probably the case. For this stage I wrote a simple mbed program to pass input from a terminal on the pc to the device - program. If you are experimenting, it is advisable to have write in a few hotkeys that will execute commands you use often (HTTP GET request for example).

A basic hardware configuration (if you don't use a battery to power the module) is:

RN-131+++++RN-XV
wifly pinMbed pinwifly_pinMbed pin
3.3V RINGND
GNDGNDGNDGND
VDD BATTVOUT
VDD INVOUTVDD_3V3VOUT
RXTXUART_RXTX
TXRXUART_TXRX
GPIO 6any DigitalInGPIO 6any DigitalIn
RESETany DigitalInRESETany DigitalIn

Information

If everything is connected correctly, you should get the response "CMD" when you put in three consecutive dollar signs "$$$". The module is now in command mode. To return the module to this factory state, if you want to, you should enter in command mode "factory RESET\r".

Here is a configuration example:

/media/uploads/samux/wifly_conf.png

  • First I enter in command mode by pressing $$$
    • the response is CMD
  • set wlan ssid my_network
    • the response is AOK (AOK has replaced set... local echo activated)
  • set wlan phrase my_password (I use set wlan phrase because my network use WPA as security. If you have a WEP security, you have to use set wlan key your_password)
    • the response is AOK
  • join my_ssid
    • the response is quite long but Associated! means that you are connected

There are a lot of commands to configure the wifly module. Please take a look to the user manual if you want more information on all possible commands.

Hello World!

Please be sure to read the Wifly datasheet and API of Wifly class, if you are using it, for maximum ease of use.

#include "mbed.h"
#include "WiflyInterface.h"

Serial pc(USBTX, USBRX);

/* wifly object where:
*     - p9 and p10 are for the serial communication
*     - p25 is for the reset pin
*     - p26 is for the connection status
*     - "mbed" is the ssid of the network
*     - "password" is the password
*     - WPA is the security
*/
WiflyInterface wifly(p9, p10, p25, p26, "mbed", "password", WPA);

int main() {
    wifly.init(); // use DHCP
    while (!wifly.connect()); // join the network
    printf("IP Address is %s\n\r", wifly.getIPAddress());
    wifly.disconnect();
}

» Import this programWifly_HelloWorld

Hello World with a wifly module (RN 131 C/G - RN-XV)

The previous program tries to connect the network. If the network is joined, it prints the ip address of the wifly module.

Things to be aware of:

  • If sending data using the on board TCP/IP stack, it might be necessary, if you are experiencing problems, to change the flush size/timeout to the maximum, or it sends the data as it receives it.
  • Sometimes an unresponsive module will need an external reset (there is also a watchdog), might need to be part of a design to guard from total failure. This is not uncommon when the server is very unreliable (when you are using your own) or there is some disconnection between the module and the router (due to intefearance/distance)
  • Need to be aware of times to complete commands such as connecting to a network, as DHCP can take a while among other things. Rather than looking for ascii confirmation of things like an open TCP connection, it may be easier to configure one of the GPIO pins to do the job.

Stuff the WiFly can do

  • Communicate over wifi
  • Upgrade its firmware over TCP
  • Sleep
  • Be controlled completely using GPIO pins.
  • Operate in wifi or ad-hoc mode
  • Operate as a standalone server

Programs using this library:

Projects with this module:




3 related questions:


30 comments:

06 Nov 2011

hi - is this hello world example out of date now? It seems that the examples in the Internet of Things and Webservers tutorials use different libraries and syntax. For example specify wifi object as:

Wifly wifly(p9, p10, p20, "network", "password", true);

and join with

wifly.join())

I can't get wifly to connect to my network, and it's hard to debug not knowing which syntax to use. Any help most appreciated :)

06 Nov 2011

Hi Rob,

Yes the API is join and not Join. The Hello World has been updated. To debug, you can define the symbol DEBUG in wifly.cpp to see where is the problem: #define DEBUG. I advice you to test your by following the getting started section by using the program to send and receive commands to or from the wifly module. You can try with this program (in the mbed serial port console):

  • $$$ (enter in command mode)
  • set ip dhcp 1
  • set wlan phrase your_password (if WPA)
  • set wlan key your_key (if WEP)
  • join your_network

If this doesn't work try:

  • scan (to see all networks available)

Hope this can help.

08 Nov 2011

Hi i can not detect when the client is connected ad WiFly+mbed, the wifly joined correctly to the wifi network, but when i try to read connection message response "*OPEN*" (or other message) I can not read it. Below the code I use.

#include "mbed.h"
#include "Wifly.h"

DigitalOut led1(LED1);
DigitalOut led2(LED2);
Wifly wifly(p13, p14, p20, "SSID", "pass", true);
char reading[10];
bool connected=false;

int main()
{
    while(!wifly.join())  //we connect to the network
    {
        printf("Join failed!\r\n");
        wifly.reset();
    }

    printf("Network joined!\r\n");

    wait(20);
    led1=1;
    // Check the connection from client device via telnet
    while(!connected)
    {
        while(wifly.readable())
        {
            wait(0.1);
            wifly.read(reading);
            printf("%s\r\n", reading);
        }

        if(!strcmp(reading, "*OPEN*"))
        {
            printf("Connection opened!\r\n");
            connected=true;
        }
        wait(0.5);
        led1=!led1;
    }

    led2=1;
    // SEND DATA CODE ...
}
08 Nov 2011

Hi Roberto,

I think that you have passed the most difficult step: the connection to your network :)

It's normal that you don't see *OPEN* because it only appears when you open a TCP connection. You can open a connection from the mbed like this: wifly.send("open ip_of_your_pc 444\r\n" , "OPEN*"). For instance in the websocket library, I open a TCP connection to a server via:

//open the connection
sprintf(cmd, "open %s %s\r\n", ip_domain.c_str(), port.c_str());
if (!wifi->send(cmd, "OPEN*")) {
    printf("Websocket::connect cannot open\r\n");
    return false;
} 

In fact, the "send" will sends "open ip port" and try to find in the response "OPEN*". If OPEN* is found, it means that a TCP connection is opened. So that you can connect a telnet client to your wifly module by: telnet mbed_ip 444.

If you pass this step, it will mean that you are able to send data over TCP between your mbed and your computer.

Hope that helps.

Samuel

09 Nov 2011

user Samuel Mokrani wrote:

Hi Roberto,

I think that you have passed the most difficult step: the connection to your network :)

It's normal that you don't see *OPEN* because it only appears when you open a TCP connection. You can open a connection from the mbed like this: wifly.send("open ip_of_your_pc 444\r\n" , "OPEN*").

Thanks for the quick response Samuel, but my problem is to estabilish a connection from the PC to mbed. I want wait until a PC (or other device) connecting, via telnet (or TCP socket connection) to the mbed+Wifly, to do this I try to read the "*OPEN*" message that normally generates wifly, when a connection was established. I used the following code, but I have not had the expected result.

    // Check the connection from client device via telnet
    while(!connected)
    {
        while(wifly.readable())
        {
            wait(0.1);
            wifly.read(reading);
            printf("%s\r\n", reading);
        }

        if(!strcmp(reading, "*OPEN*"))
        {
            printf("Connection opened!\r\n");
            connected=true;
        }
        wait(0.5);
        led1=!led1;
    }

Roberto

09 Nov 2011

By default, the wifly module is listening on port 2000. So if you try, telnet mbed-ip 2000, you should be able to receive "*HELLO*" in your telnet terminal and "*OPEN*" in the local UART.

09 Nov 2011

user Samuel Mokrani wrote:

By default, the wifly module is listening on port 2000. So if you try, telnet mbed-ip 2000, you should be able to receive "*HELLO*" in your telnet terminal and "*OPEN*" in the local UART.

Yes I know, but when I try not receive de "*OPEN*" message in the local UART, I not receive any message from PC to Wifly, but I need to know for stard to send a data.

25 Nov 2011

Hi Samuel,

I am very new to this wifly module as it arrived yesterday. Today, I used your program, "wifly-configure" but I got this error.

[Auto-Assoc roving1 chan=0 mode=NONE FAILED]

/media/uploads/sjchia844z/error--0-scaled-.png

My mbed configuration is as shown below:-

/media/uploads/sjchia844z/_scaled_setup_wifly.jpg

By the way, I am using Xubuntu 11.10 Oneiric Ocelot.

Thanks.

25 Nov 2011

Hi Chia,

It's normal, the module tries automatically to connect a network called "roving1". Your mbed configuration is good. Even if you see these messages, you can enter in command mode by pressing $$$. After that you can configure your wifly module:

  • set wlan ssid your_network
    • You should see in the console AOK.
  • set wlan phrase(WPA)/key(WEP) your_password
    • You should see in the console AOK.
  • set wlan auth 3
    • You should see in the console AOK.
  • save
  • reboot

Now your wifi module will automatically try to connect the network called your_network.

Hope that helps.

Sam

28 Nov 2011

It worked! Thanks, Samuel! :)

19 Dec 2011

If you can't connect to your network and the sets of the Wifly modul (SSID + Phrase and authentic. mode) are correct, try to increas the jointmr.

For example:

if(!Send("set opt jointmr 2500\r\n", "AOK")) Timeout for connection, also for Handshake -WPAx-

{

pc.printf("join: cannot set timeout\r\n"); exit(); return false;

}

Hope this will help somebody.

02 Jan 2012

I'm getting the message: Auto-Assoc roving1 chan=0 mode=NONE FAILED

When I type $$$ nothing happens. It continues to give the above message. I do not get the CMD prompt. Any thoughts?

29 Jan 2012

Arhh Help going in circles

Quote:

I'm getting the message: Auto-Assoc roving1 chan=0 mode=NONE FAILED

When I type $$$ nothing happens. It continues to give the above message. I do not get the CMD prompt. Any thoughts?

In the same boat here have connected up the mbed to the sparkfun.com breakout board. RX TX on pins 9 & 10.

I am using the code below to try and get the wifly into command mode. But every time it just ignores me and trys to connect to its default network. I am can not see what I have done wrong. There is a typical trace from the Tera Term window below also.

Try as I might I can not get Wifly to go into command mode, it seams to ignore $$$.

Do I need to send an end line character? Is there a reason I would not get back CMD?

WiFly Ver 2.23, 04-26-2011 on 131C83

MAC Addr=00:06:66:13:d5:a0

Auto-Assoc roving1 chan=0 mode=NONE FAILED

*READY*

Auto-Assoc roving1 chan=0 mode=NONE FAILED

#include "mbed.h"

Serial pc(USBTX, USBRX);
Serial wifi(p9,p10);

int main() {
    
    pc.printf("Test Wifly!\r\n");

    while (1) 
    {
        if (pc.readable())
        {
            wifi.putc(pc.getc());
        }
        if (wifi.readable())
        {
            pc.putc(wifi.getc());
        }
    }
}

29 Jan 2012

Hi James,

Be sure to connect the wifly module as:

  • Vdd-In -> VOUT
  • Vdd-Batt -> VOUT
  • Gnd -> Gnd
  • 3.3V-Rin -> Gnd

You don't need to send an endline character.

Hope this helps

Sam

30 Jan 2012

user Samuel Mokrani wrote:

Hi James,

Be sure to connect the wifly module as:

  • Vdd-In -> VOUT
  • Vdd-Batt -> VOUT
  • Gnd -> Gnd
  • 3.3V-Rin -> Gnd

You don't need to send an endline character.

Hope this helps

Sam

Thanks Sam,

I have got the unit up and running, I read further in the documentation, and have got into command mode remotely. I am receiving communications from the Wifly its letting me know it is connected to the network using the serial port, but I can not get the mbed to send information to it, the wifly unit just ignores any attempts to enter command mode, its driving me potty!

07 Feb 2012

Using the function 'TCP opt password' the first package that I have to send is the TCP password. when I do a connection with a wrong TCP password, it sended to UART the message *OPEN* *CLOS*, the status of this connection is changed to closed the wifly led flashes to desconected, but it continues receiving data and if I open a new connection there will be two connection opened! I did the socket and I'm using Ubuntu 11.10.

With telnet works normaly.

**Part of the socket**

ret = connect(sockfd, (const struct sockaddr *) &endWifly, sizeof(struct sockaddr_in));
   if (ret < 0){
      fprintf(stderr,"ERRO: nao foi possivel abrir conexao com o servidor\n");
      exit(0);
   }

   //sends a package with the TCP password, the problem occurs when this is not sended, the connection is closed but
   //the 'ret' inside the 'while(1)' continues to sends data
   ret = write(sockfd, "mbed", strlen("mbed"));

   while(1){     
      /*printf("Digite uma string (ate 20 caracteres):\n>>");
      fgets(string, 20, stdin);*/
      
      if(cont == 1000){
         cont = 0;
      } else{
         cont++;
      }
      sprintf(string, "%d+", cont);
   
      ret = write(sockfd, string, strlen(string));
      if (ret < 0){
         fprintf(stderr,"ERRO: envio falhou\n");
         exit(0);
      }
      printf("%s\n", string);

      sleep(4);
   }
   
   //fecha socket
   close(sockfd);
   
   return 0;
}

and this second code was added into the join() function of the wifly library

if (!send("set o p mbed\r\n", "AOK")) {
#ifdef DEBUG
            printf("Wifly::join: cannot set password tcp\r\n");
#endif
            exit();
            return false;
        }

Thanks for help!

16 Feb 2012

Hey Samuel,

I just bought the WiFly RN-131C and I would like to connect it to the mbed. I did not find the datasheet very helpful in specifying exactly which pin goes to which pin, even from Wifly breakout itself doesn't make much sense to me. Would you be able to clarify this to me please?

From the Wifly breakout pin specified are: V3, GD, RX, TX, RT, CT, P4, P5, P6, P7, P8, RS I understand that pins required for connection are 3.3V, GND, VDD BATT, VDD IN, TX, RX, RST

Your help will be grateful

Adilson

04 May 2012

Does, this example code work for the LPC11U24?

09 May 2012

We bought the RN-XV WiFly from sparkfun and connected everything and the hello world provided above seems to work; however, after some modifications we found some significant problems.

First of all we are having trouble running the code reliably. The code seems to hang sometimes before displaying the "network joined" message; we added an extra printf() right after the buffer declaration to see where the code was failing. Note that the WiFly DID successfully connect to the network, thus the error message did not show, but somehow the code after that didn't execute. This occurs somewhat frequently so its becoming a very serious problem that we're not sure how to solve.

The second problem is that the read() method sometimes returns an incomplete message; in other words, it reads part of a message. We're guessing it's because that the read() method is being called before the WiFly module has finished filling the buffer with the received message; however, we don't know of a way to reliably wait for the WiFly to finish receiving data.

Also, sometimes the WiFly will write IP information to stdout, which is puzzling since it isn't in the code; it also doesn't show up very often. We do need this piece of information so we tried using CMD mode to get it. This approach gave us mixed results. Entering CMD mode was almost always successful, but sending "get ip" doesn't always returns the information as expected; sometimes the response will just be a carriage return character and nothing else. Also, we couldn't exit out of CMD mode by either calling the exit() method or sending "exit"; we confirmed with telnet that the exit command is recognized correctly by the WiFly, but we just couldn't do it with the mbed program.

We're pretty lost on this, so any help with the above is greatly appreciated.

09 May 2012

Hi All,

@Hermann: As there is only one serial port on the mbed LPC11U24, the "printfs" in the hello world program are sent to the wifly module. We do not want this so you can delete all "printfs" in this program.

@WASP: I will investigate the problem as soon as possible. Are you using the LPC11U24 or the LPC1768 ?

Sam

09 May 2012

user Samuel Mokrani wrote:

Hi All,

@Hermann: As there is only one serial port on the mbed LPC11U24, the "printfs" in the hello world program are sent to the wifly module. We do not want this so you can delete all "printfs" in this program.

@WASP: I will investigate the problem as soon as possible. Are you using the LPC11U24 or the LPC1768 ?

Sam

We're using the LPC1768. Also, the second problem about read not reading the whole message is probably a fault of TCP; it doesn't guarantee messages are sent and received 1:1. We'll just have to deal with that with protocol design.

10 May 2012

I have been able to get a connection to my router and I have even created a VB application using sockets where I can connect to my WiFly and get the *HELLO* response. I can send text from the VB form to the Wifly and see it in the TeraTerm screen. However what I want to do is establish a 2 way communication with the WiFly so I could read sensor inputs from Wifly and also send commands to Wifly to cause pins to go high or low. Its taken quite a while to get this far while I am revising for exams all the time and time for mbed and embedded electronics is hard to come by. I think my understanding of sockets, ( I'm using a VB control called winsock ) is perhaps incomplete. My Wifly is using port 2000 so I can speak to it. I've attached a word doc with screendump. Any thoughts anyone ?

11 May 2012

user Gregory Martin wrote:

I have been able to get a connection to my router and I have even created a VB application using sockets where I can connect to my WiFly and get the *HELLO* response. I can send text from the VB form to the Wifly and see it in the TeraTerm screen. However what I want to do is establish a 2 way communication with the WiFly so I could read sensor inputs from Wifly and also send commands to Wifly to cause pins to go high or low. Its taken quite a while to get this far while I am revising for exams all the time and time for mbed and embedded electronics is hard to come by. I think my understanding of sockets, ( I'm using a VB control called winsock ) is perhaps incomplete. My Wifly is using port 2000 so I can speak to it. I've attached a word doc with screendump. Any thoughts anyone ?

We're actually doing something similar, but we're coding in C# instead ;)

We're not sure what winsock is doing, but we use the .NET class TCPClient to setup a TCP connection to the WiFly, and then call the read() and write() methods of the Stream class to send data over the link. You can't directly command the mbed this way, so you'd have to design a protocol that recognizes certain messages and call functions to do things in the coding of the mbed. For example:

char recv[1024];

wifly.read(recv);   //read some data in from the wifly

//find keywords in the messages and do stuff
if (strstr(recv, "PIN_HIGH")) doPinHigh();
if (strstr(recv, "PIN_LOW")) doPinLow();

Of course, TCP connections doesn't guarantee messages to be sent 1 to 1; that is, a message sent can be received as multiple segments. You'd have to deal with this with protocol design, either by specifying the length of the message at the very beginning, or use delimiters to indicate the end of a single message.

Hope this helps in what you are doing. If you want, we have already written a .NET application that connects to a given IP and port with TCPClient, and is capable of sending and receiving messages.

16 Aug 2012

Hi Samuel, I borrowed a wifly module and am using it with the LPC1768, but was having major problems connecting to a wireless signal. I was able to use your configure code and connect via the terminal pretty easily. However, I was never able to get your HelloWorld code to work. In fact my mbed folder would disappear which I assume is the mbed crashing whenever I tried to run the code.

Rob Toulson helped me with some of his code and I realized his wifly.cpp code in the wifly library has significant changes to yours, but if I uploaded his library with your code it worked. There are numerous changes but some examples are:

__ bool Wifly::send(char * str, char * ACK, char * res) { char read; size_t found = string::npos; string checking; Timer tmr;

  1. ifdef DEBUG printf("will send: %s\r\n",str);
  2. endif

attach_rx(false); if (!ACK || !strcmp(ACK, "NO")) { wifi.printf("%s", str); } else { We flush the buffer while (wifi.readable()) wifi.getc(); tmr.start(); wifi.printf("%s", str); _

if ( res != NULL) { int i = 0; Timer timeout; timeout.start(); while (1) { if (timeout.read() > 3) { read = NULL; attach_rx(true); return false; } else { if (tmr.read_ms() > 500) { res[i] = 0;

  1. ifdef DEBUG printf("user str: %s\r\n", res);
  2. endif break; } if (wifi.readable()) { tmr.start(); read = wifi.getc();

wa have detected an end of response if (read == '<') { res[i] = 0; break; }

we drop \r and \n if ( read != '\r' && read != '\n') { res[i++] = read; } } } }

  1. ifdef DEBUG printf("user str: %s\r\n", res);
  2. endif } attach_rx(true); return true; } _

As well as many more unfortunately. Of course, my problems carried over to the websockets code. I was originally unable to connect to the wifi until I replaced the library, but then my code never connects to the websockets server (at least it doesn't crash). I understand this is not very helpful since I only gave you a portion of Robs library and other people seem to not have any issues, but If you have any recommendations on what I'm doing wrong or if you can think of any issues I could be having with the websockets library as well that would be greatly appreciated. Thanks

06 Sep 2012

Gah, so the Wifly_hello world example compiles and works, but when I try to compile my other project, it fails to compile.

WiflyInterface/Socket/Endpoint.cpp:

line 25: identifier "wifly" is undefined

line 25: name followed by "::" must be a class or namespace name

line 27: identifier "error" is undefined

lines 34, 40, 49: identifier "_port" is undefined

line 39: identifier "wifly" is undefined

WiflyInterface/Socket/TCPSocketServer.cpp:

lines 29, 53: identifier "wifi" is undefined

Any idea why hello world compiles but not the same library and revision in my project?

06 Sep 2012

Hi Nick,

Can you post the link of your project ?

Thanks, Sam

30 Jan 2013

Well, I am using the RN-XV with the LPC1768 and I had a couple of questions stated below:

1) How to pass the $$$ etc commands to the wifly module. I tried the XBee explorer board but it seems as it the entire wifly modules doesn't really fit well into the pins. 2) What code is supposed to be used to connect? Is it the wifly.join() or wifly.connect()? 3) Can I send the commands like '$$$' and the ones by which I can set the wifi ssid and wifi password somehow from the mBed? I know my mbed is connected to the router since I can read the MAC address of the chip. 4) Doesn't the WiflyInterface wifly (......) take care of the command mode and whatever needs to be done initially to configure the Wifly module?

Immediate replies will be really helpful.

user Samuel Mokrani wrote:

Hi Rob,

Yes the API is join and not Join. The Hello World has been updated. To debug, you can define the symbol DEBUG in wifly.cpp to see where is the problem: #define DEBUG. I advice you to test your by following the getting started section by using the program to send and receive commands to or from the wifly module. You can try with this program (in the mbed serial port console):

  • $$$ (enter in command mode)
  • set ip dhcp 1
  • set wlan phrase your_password (if WPA)
  • set wlan key your_key (if WEP)
  • join your_network

If this doesn't work try:

  • scan (to see all networks available)

Hope this can help.

30 Jan 2013

Hi,

1) How to pass the $$$ etc commands to the wifly module. I tried the XBee explorer board but it seems as it the entire wifly modules doesn't really fit well into the pins.

You just need a serial communication between the mbed and the wifly module as stated in the hardware section.

2) What code is supposed to be used to connect? Is it the wifly.join() or wifly.connect()?

If you take a look at the wiflyInterface API, there is not wifly.join(). So you can only use wifly.connect().

 3) Can I send the commands like '$$$' and the ones by which I can set the wifi ssid and wifi password somehow from the mBed? I know my mbed is connected to the router since I can read the MAC address of the chip.
4) Doesn't the WiflyInterface wifly (......) take care of the command mode and whatever needs to be done initially to configure the Wifly module?

You can send these commands by calling methods from WiflyInterface (connect() will configure the wifly module).
Have you tried the HelloWorld example to connect your wifly module to your router?

Cheers, Sam

31 Jan 2013

user Samuel Mokrani wrote:

You can send these commands by calling methods from WiflyInterface (connect() will configure the wifly module).
Have you tried the HelloWorld example to connect your wifly module to your router?

Hi Sam, Well I got the initial configuration set up. I can see in my router that my WIFLY_EZX does infact get a IP address. /media/uploads/Neel/screen_shot_2013-01-30_at_23.02.06.png

This can be seen from the attached screenshot. However, when I try to run the hello world program, the program doesn't move ahead from wifly.connect() statement. I am not sure where am I going wrong.

01 Feb 2013

Is anyone working on setting up a number of clients communicate over wifly to the server?

Any help that one can provide will be greatly appreciated.